Sunday, May 14, 2017

Help needed in passing arguments from command line in bash

#function myfunc
myfunc(){
echo $1
case $1 in


e)
a=5
;;
q)
a=10
;;

esac
}


myfunc


I need help in following :



$myfunc.sh e


echo $1 is not showing anything. case is also not working. What am I doing wrong?

No comments:

Post a Comment

11.10 - Can't boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...