LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 05-09-2011, 12:08 AM   #1
saini_mw
Member
 
Registered: Jun 2005
Location: On the top of the World
Posts: 114

Rep: Reputation: 15
what does =~ means in if test statement.


Hello Guys,

I am trying to modify a shell script according to my requirements & i am seeing an if statement like below:

if [[ "$i" =~ "you are guest " ]] ; then
echo "Welcome Guest"

Now, can someone please tell me what does that =~ test condition means???

It isn't causing any problems to me in modifying the script but just curious to know what it is exactly..

Thx in advance.
 
Old 05-09-2011, 12:33 AM   #2
grail
Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 7,562

Rep: Reputation: 1939Reputation: 1939Reputation: 1939Reputation: 1939Reputation: 1939Reputation: 1939Reputation: 1939Reputation: 1939Reputation: 1939Reputation: 1939Reputation: 1939
This should help.
 
1 members found this post helpful.
Old 05-09-2011, 12:44 AM   #3
saini_mw
Member
 
Registered: Jun 2005
Location: On the top of the World
Posts: 114

Original Poster
Rep: Reputation: 15
thx man!!
 
Old 05-09-2011, 01:15 PM   #4
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 713Reputation: 713Reputation: 713Reputation: 713Reputation: 713Reputation: 713Reputation: 713
Mark the thread as solved.
 
  


Reply

Tags
bash, regular expression


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Shell script for adding a statement in a file after a particular statement TheIndependentAquarius Programming 4 06-28-2010 03:07 AM
Problem with if statement in a find -exec statement romsieze Programming 2 10-02-2008 12:38 AM
EASY scripting question - trying to figure out a test statement Elendrael Linux - Newbie 1 09-16-2007 07:52 PM
LXer: Defence statement released in Israeli GPL test LXer Syndicated Linux News 0 04-03-2007 03:31 PM
What does this statement means ? indian Programming 4 04-25-2005 03:50 PM


All times are GMT -5. The time now is 03:39 AM.

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