Skip to main content

You can use this simple script for creating options

#!/bin/bash
echo "select the operation ************"
echo "  1)operation 1"
echo "  2)operation 2"
echo "  3)operation 3"
echo "  4)operation 4" 
read n case $n in

  1. echo "You chose Option 1";;
  2. echo "You chose Option 2";;
  3. echo "You chose Option 3";;
  4. echo "You chose Option 4";; *) echo "invalid option";; esac

#!/bin/bash
echo "select the operation ************"
echo "  1)operation 1"
echo "  2)operation 2"
echo "  3)operation 3"
echo "  4)operation 4" <br/>
read n
case $n in
  1) echo "You chose Option 1";;
  2) echo "You chose Option 2";;
  3) echo "You chose Option 3";;
  4) echo "You chose Option 4";;
  *) echo "invalid option";;
esac

You can use this simple script for creating options

#!/bin/bash
echo "select the operation ************"
echo "  1)operation 1"
echo "  2)operation 2"
echo "  3)operation 3"
echo "  4)operation 4" 
read n case $n in

  1. echo "You chose Option 1";;
  2. echo "You chose Option 2";;
  3. echo "You chose Option 3";;
  4. echo "You chose Option 4";; *) echo "invalid option";; esac

You can use this simple script for creating options

#!/bin/bash
echo "select the operation ************"
echo "  1)operation 1"
echo "  2)operation 2"
echo "  3)operation 3"
echo "  4)operation 4" <br/>
read n
case $n in
  1) echo "You chose Option 1";;
  2) echo "You chose Option 2";;
  3) echo "You chose Option 3";;
  4) echo "You chose Option 4";;
  *) echo "invalid option";;
esac
Updated this short script to run as is, and broke up the menu lines.
Source Link

You can use this simple script for creating options

  
#!/bin/bash
echo "select the operation ************  1)operation 1 2)operation 2 3)operation 3 4)operation 4 "

read n
case $n in
    1) commands for opn 1;;
    2) commands for opn 2;;
    3) commands for opn 3;;
    4) commands for  opn 4;;
    *) invalid option;;
esac
#!/bin/bash echo "select the operation ************" echo " 1)operation 1" echo " 2)operation 2" echo " 3)operation 3" echo " 4)operation 4"
read n case $n in

  1. echo "You chose Option 1";;
  2. echo "You chose Option 2";;
  3. echo "You chose Option 3";;
  4. echo "You chose Option 4";; *) echo "invalid option";; esac

You can use this simple script for creating options

 
#!/bin/bash
echo "select the operation ************  1)operation 1 2)operation 2 3)operation 3 4)operation 4 "

read n
case $n in
    1) commands for opn 1;;
    2) commands for opn 2;;
    3) commands for opn 3;;
    4) commands for  opn 4;;
    *) invalid option;;
esac

You can use this simple script for creating options  

#!/bin/bash
echo "select the operation ************"
echo "  1)operation 1"
echo "  2)operation 2"
echo "  3)operation 3"
echo "  4)operation 4" 
read n case $n in

  1. echo "You chose Option 1";;
  2. echo "You chose Option 2";;
  3. echo "You chose Option 3";;
  4. echo "You chose Option 4";; *) echo "invalid option";; esac
two little errors (!# instead of #! and a missing r in the 4th choice)
Source Link

You can use this simple script for creating options

!#!/bin/bash
echo "select the operation *********************  1)operation 1 2)operation 2 3)operation 3 4)operation 4 "

read n
case $n in
    1) commands for opn 1;;
    2) commands for opn 2;;
    3) commands for opn 3;;
    4) commands fofor  opn 4;;
    *) invalid option;;
esac

You can use this simple script for creating options

!#/bin/bash
echo "select the operation *********  1)operation 1 2)operation 2 3)operation 3 4)operation 4 "

read n
case $n in
    1) commands for opn 1;;
    2) commands for opn 2;;
    3) commands for opn 3;;
    4) commands fo  opn 4;;
    *) invalid option;;
esac

You can use this simple script for creating options

#!/bin/bash
echo "select the operation ************  1)operation 1 2)operation 2 3)operation 3 4)operation 4 "

read n
case $n in
    1) commands for opn 1;;
    2) commands for opn 2;;
    3) commands for opn 3;;
    4) commands for  opn 4;;
    *) invalid option;;
esac
Source Link
jibin
  • 249
  • 2
  • 2
Loading