multiple lines inside a case statement

echo "please enter ur choice..
1.      Make a file.
2.      Display contents
3.      Copy the file
4.      Rename the file
5.      Delete the file
6.      Exit"
read choice
case $choice in
        1 ) echo enter the file name
        read fname
        if [ -e $fname ]
        then
        echo file name already exists
        else
        `touch $fname`
        echo the file $fname has got created.. plz enter  something               
read content
        cp content $fname ;;
        2 ) echo enter the file name to be displayed
        read fname
        if [ -e $fname ]
        then
        echo contents of the file $fname is :
        `cat $fname`;;
        3 ) echo under construction ;;
        4 ) echo under construction ;;
        5 ) echo under construction ;;
        6 ) echo "bye !!" ; exit;;
        * ) somethinggggggggg?? ;;
esac
 

###################################
i am getting error here because of ;;
Am i supposed to provide ;; at the end of every line or wat?? plz guide

No, only at the end.

You're missing an fi in your first and second cases.

And there's no need to use backticks to execute cat and touch. They can execute all by themselves :slight_smile:

thanks :slight_smile:
its done now.