LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   escape '*' in case statement bash (https://www.linuxquestions.org/questions/programming-9/escape-%2A-in-case-statement-bash-784171/)

junust 01-23-2010 03:21 AM

escape '*' in case statement bash
 
Hello,

Does it possible to escape * in the case statement

Code:


case $tst in
- )
echo -
;;
+ )
echo +
;;
: )
echo :
;;
* ) # It should be option, and don't treated like 'any other case'
echo *
;;
= )
echo =
;;
* )
echo Tty -.+,:,*
;;
esac


Thanks

tuxdev 01-23-2010 03:40 AM

Quote it. Pick whichever you like best: "*", '*', or \*

junust 01-23-2010 03:54 AM

Thanks, That is it!


All times are GMT -5. The time now is 12:33 AM.