LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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
  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: 81

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,012

Rep: Reputation: 115Reputation: 115
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: 81

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


Reply



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



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

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

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

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration