![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to check whether a string is number or not | shihabvk | Shell Programming and Scripting | 12 | 04-28-2009 12:29 AM |
| check the given string is numeric or not. | knowledge_gain | High Level Programming | 11 | 02-03-2009 11:25 AM |
| how to check string of character | manas_ranjan | Shell Programming and Scripting | 9 | 05-12-2008 08:20 AM |
| read string, check string length and cut | ozzy80 | Shell Programming and Scripting | 9 | 03-21-2007 05:56 PM |
| check whether variable number or string | rolex.mp | UNIX for Dummies Questions & Answers | 4 | 02-22-2007 12:12 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
How to check a string in the variable
hi,
I have a variable var1 as follows in the script. var1="one two three desformat=PDF xyz" I would like to check whether $var1 has a string "desformat=PDF" or not. Is there any command I can use (not need to creat a file)? Currently, I am using this: if ( grep "desformat=PDF" $chkpdf 1>/dev/null ) then --$chkpdf is a file contains the string a parameter Thanks. Cheers, Joseph |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|