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
 
LinkBack Search this Thread
Old 02-04-2010, 03:55 AM   #1
saiteju
LQ Newbie
 
Registered: Feb 2010
Posts: 6

Rep: Reputation: 0
validity of a variable


How do i check if a string entered by a user starts with a particular pattern or not??

Thanks,
Sai.
 
Old 02-04-2010, 04:10 AM   #2
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: ubuntu
Posts: 2,524

Rep: Reputation: 93
What programming langauge?
 
Old 02-04-2010, 04:30 AM   #3
saiteju
LQ Newbie
 
Registered: Feb 2010
Posts: 6

Original Poster
Rep: Reputation: 0
shell scripting...

Thanks,
Sai.
 
Old 02-04-2010, 04:59 AM   #4
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Slackware 13.37, Debian Squeeze
Posts: 7,987
Blog Entries: 25

Rep: Reputation: 1009Reputation: 1009Reputation: 1009Reputation: 1009Reputation: 1009Reputation: 1009Reputation: 1009Reputation: 1009
Code:
case "$var" in
     mystring* )
         echo 'Got it!'
         ;;
     * )
         echo 'You must be joking!'
esac
 
  


Reply

Tags
matching, pattern


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
Check of proxy address validity in Linux vitalstrike82 Linux - Networking 2 05-04-2009 09:41 AM
validity of html code in php scripts rblampain Programming 4 01-21-2006 09:24 AM
Pondering the validity of turning laptop into wireless hub. numerous Linux - Laptop and Netbook 1 01-18-2005 09:22 PM
Redhat 9 Disk 2 Validity Problem Ledoreous Linux - Newbie 2 08-30-2004 07:50 PM
qmail doesn't check local users validity through /etc/passwd mimi Linux - Networking 5 07-24-2002 02:50 PM


All times are GMT -5. The time now is 06:03 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
Open Source Consulting | Domain Registration