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