#!
/bin/tcsh
set l = `ls`
foreach i ($l)
if ($i !~ "*.txt") then
echo $i
endif
end
echo "------------------"
foreach i ($l)
if ($i =~ "*.txt") then
echo $i
endif
end
exit
echo "The no of arguments passed are: $#argv"
echo "The list of arguments are: $* "
echo "The first argument is: $1"
echo "The first argument is: $argv[1]"
echo "file name getting executed is: $0"
foreach i ($*)
echo $i
end
exit
echo -n "Enter a file name which is existing with its path: "
set p = ($<)
if (-de $p) then
echo "$p is a directory"
else
echo "$p may be it is not a directory or it is not existing"
endif
exit
set i = 1
while ($i <= 10)
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: "
set 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 = ($<)
if ($n > 0) then
echo "$n is a positive number"
else
if ($n < 0) then
echo "$n is a negative number"
else
echo "$n is a ZERO"
endif
endif
end
exit
exit
foreach i (`ls`)
echo "$i --- Foreach looop"
end
set i = 1
set l = `ls`
while ($i <= $#l)
echo "$l[$i] --- WHile loop"
set i = `expr $i + 1`
end
exit
echo -n "ENter a list of gates: "
set gates = ($<)
foreach i ($gates)
foreach j (RED GREEN BLUE)
echo "$i --- $j"
end
end
echo $i
exit
#set gates = (AND OR NOT BUFF NAND)
echo -n "ENter a list of gates: "
set gates = ($<)
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 "The add value is `expr 1000 + $b`"
echo $a[1-4]
echo $#a
exit
echo "awk 'BEGIN{a=ARGV[1];b=ARGV[2];print a+b}' $a $b"
echo 'expr $a + $b'