Operations Using Menu

Write A Script To Perform Following String Operation Using Menu.

  • COMPARE TWO STRINGS.
  • JOIN TWO STRINGS.
  • FIND THE LENGTH OF A GIVEN STRING.
  • OCCURRENCE OF CHARACTER AND WORDS
  • REVERSE THE STRING.

 

echo -e “enter user name::\c”

read n

who | grep “^$n”

 

echo $?

if [ $? -eq 0 ]

then

echo “currently log in”

else

echo “not log in”

fi

OUTPUT::

enter user name::3002

3002     pts/5        2012-10-08 14:25 (LAB202)

0

currently log in

 

 

Share

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.