-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcsh
57 lines (47 loc) · 1.14 KB
/
csh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
################################################
#!/bin/csh
echo -n "What was your grade on the test? "
set grade = $<
switch ("$grade")
case "$grade >= 90 && $grade <= 1000" :
echo "You got an A!"
breaksw
case "$grade >= 80 && $grade <= 89" :
echo "You got a B."
breaksw
case "$grade >= 70 && $grade <= 79" :
echo "You're average."
breaksw
case "$grade >= 60 && $grade <= 69" :
echo "Better study harder"
breaksw
default :
echo "Invalid Input"
breaksw
endsw
#######testing###Note:the echos are not complete########
#!/bin/csh -f
echo -n "What file would you like to test? "
set test = $<
echo -n "What yould you like to test it for?"
echo "1)Is it readable?"
echo "2)Is it a symbolic link?"
echo "3)Does it have hidden attributes?"
set choice = $<
expr{}
if choice = 1 then
echo readable
if choice = 2 then
echo link
if choice = 3 then
echo attrib
else echo "That is not a valid entry"
end
######################numbers########################
#!/bin/csh
echo -n "whats your lucky number?"
set number = $<
if ($number != 13) then
else echo "Unlucky number"
exit 1
########################end##########################