You are on page 1of 4

Function capitalize(input,result,words,no,I,w)

Result=””

No=split(input,words,””)

for(i=1;i<n;i++)

W=words[i];

W=toupper(substr(w,1,1))

If(i>1)

Result=result””

Result=result w

printf capitalize($0)

prrrrrrrrrrrrrrrrrrrrooooooooooooooooooooooENDooggggggggggggggggggggggggrrrrrrrrrrraaaaaaaaam

IFS=”|”

Echo Enter a file name

Read file

If[-f $file]

Then

Echo $file exists

Opt=1

Else

$file not exists

Echo

Fi

While [$opt –eq 1]


Do

Echo Enter your option

Echo 1.Search by ID

Echo 2.Search by Designation

Echo 3.Search by Department

Read no

Case $no in

1)echo “ID:”

Read ID

Grep ^ID $file

;;

2)echo “Department:”

Read Dept

Grep –E –I $Dept $File

;;

3)echo “Designation”

Read Design

Grep –f –I $Desi $file

;;

*)echo Enter the option 1/2/3

Esac

Echo “Do you want to continue? Yes-1”

Read option

Done

prrrrrrrrrrrrrrrrrrrrooooooooooooooooooooooENDooggggggggggggggggggggggggrrrrrrrrrrraaaaaaaaam

12

123

123456

Prog.
echo Enter the number
read n
for ((i=1;i<=n;i++))
do
for ((j=1;j<=i;j++))
do
echo -e "$j\c"
done
echo ""
done

prrrrrrrrrrrrrrrrrrrrooooooooooooooooooooooENDooggggggggggggggggggggggggrrrrrrrrrrraaaaaaaaam

echo Input Number


read no
echo Input Power
read power
counter=0
ans=1
while [ $power -ne $counter ]
do
ans=`expr $ans \* $no`
counter=`expr $counter + 1`
done
echo The Answer is : $ans
prrrrrrrrrrrrrrrrrrrrooooooooooooooooooooooENDooggggggggggggggggggggggggrrrrrrrrrrraaaaaaaaam

echo Enter String


read str
len=`echo $str |wc -c`
vowel=0
a=1
while [ $a -lt $len ]
do
str1=`echo $str |cut -c $a`
if [ $str=a -o $str=e -o $str=i -o $str=o -o $str=u ]
then
vowel=`expr $vowel + 1`
fi
a=`expr $a + 1`
done
echo Total no of vowel in $str:$vowel
prrrrrrrrrrrrrrrrrrrrooooooooooooooooooooooENDooggggggggggggggggggggggggrrrrrrrrrrraaaaaaaaam

echo enter the string:

read str

echo “Enter the character to be replace”

read char

echo “enter the new chracter”

read newchar

len=`echo $str|wc -c`

a=0

while[ $str1 = $char]


then

str1=$newchar

fi

temp=’echo $temp $str’

a=`expr $a+1`

done

echo “The new string is $temp”

prrrrrrrrrrrrrrrrrrrrooooooooooooooooooooooENDooggggggggggggggggggggggggrrrrrrrrrrraaaaaaaaam

You might also like