Unix Basic Shell SCript Programming- Check Case Sensitive- Find Numer of Links

Write a shell program to know whether the given character is a number or
small case letters or capital letters by using ‘case’.

clear
echo "enter a character"
read c
case $c in
[0-9]) echo "these r numbers";;
[a-z]) echo "these r small";;
[A-Z]) echo "these r caps";;
*)
echo "invalid argument";;
esac
check number or small case letters or capital letters by using ‘case’.
Write a shell program to perform add, sub, mul, div by choice.
clear
echo "1.add"
echo "2.sub"
echo "3.mul"
echo "4.div"
echo "enter a,b values"
read a
read b
read ch
case $ch in
1)c=` expr $a + $b `
echo $c;;
2)c=` expr $a - $b `
echo $c;;
3)c=` expr $a \* $b `
echo $c;;
4)c=` expr $a / $b `
echo $c;;
*)echo "invalid
Write a shell program to know the number of links of a file.
clear
echo "enter a file"
read fn
ls -l $fn | awk '{print $2}'
shell program to know the number of links of a file.

Post a Comment

0 Comments