LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 01-23-2010, 03:21 AM   #1
junust
Member
 
Registered: Jul 2008
Location: Israel Ramat Gan
Distribution: CentOs 5.3, SuSe 11.1, Solaris 9, Slackware 13
Posts: 78

Rep: Reputation: 15
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

Last edited by junust; 01-23-2010 at 03:22 AM.
 
Old 01-23-2010, 03:40 AM   #2
tuxdev
Senior Member
 
Registered: Jul 2005
Distribution: Slackware
Posts: 2,008

Rep: Reputation: 110Reputation: 110
Quote it. Pick whichever you like best: "*", '*', or \*
 
Old 01-23-2010, 03:54 AM   #3
junust
Member
 
Registered: Jul 2008
Location: Israel Ramat Gan
Distribution: CentOs 5.3, SuSe 11.1, Solaris 9, Slackware 13
Posts: 78

Original Poster
Rep: Reputation: 15
Thanks, That is it!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] BASH --> esc key in a case statement manwithaplan Linux - Newbie 6 10-05-2009 10:33 PM
Pattern matching in a bash case statement using regex ciphyre Programming 1 01-31-2009 12:20 PM
Case statement with If statement cbo0485 Linux - Newbie 4 11-07-2007 08:05 PM
bash case statement with multiple command line options pwc101 Programming 16 06-01-2007 11:43 AM
Pattern matching with a "case" statement in BASH King V Programming 8 04-27-2006 04:19 PM


All times are GMT -5. The time now is 06:34 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration