Professional Documents
Culture Documents
TCSH Script
TCSH Script
/bin/tcsh
set l = `ls`
foreach i ($l)
echo $i
endif
end
echo "------------------"
foreach i ($l)
echo $i
endif
end
exit
echo "The no of arguments passed are: $#argv"
foreach i ($*)
echo $i
end
exit
echo -n "Enter a file name which is existing with its path: "
set p = ($<)
endif
exit
set i = 1
if ($i == 5) then
set i = `expr $i + 1`
continue
else
echo $i
set i = `expr $i + 1`
endif
end
exit
echo -n "Enter a list of gates: "
foreach i ($gates)
switch ($i)
case AND:
echo "$i is ANDing"
breaksw
case OR:
echo "$i is ORing"
breaksw
default:
echo "$i is Neither ANDing nor ORing"
breaksw
endsw
end
exit
switch
exit
while (1)
echo -n "Enter a single number: "
set n = ($<)
else
if ($n < 0) then
else
endif
endif
end
exit
exit
foreach i (`ls`)
echo "$i --- Foreach looop"
end
set i = 1
set l = `ls`
exit
echo -n "ENter a list of gates: "
set gates = ($<)
foreach i ($gates)
end
end
echo $i
exit
echo $gates
echo $#gates
echo $gates[1-4]
exit
set l = `ls`
echo $l
echo $#l
exit
echo "Welcome to LINUX TRAINING"
echo -n "Enter a list of numbers: "
set a = ($<)
set b = 300
echo $a[1-4]
echo $#a
exit
echo "awk 'BEGIN{a=ARGV[1];b=ARGV[2];print a+b}' $a $b"