Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using the If statement

Status
Not open for further replies.

roger55

Programmer
Sep 1, 2003
3
US
I tried this command but get a syntax error:

if [ ! \( -s $x -ge A600.prn -a -s $x -le A699.prn \) -a ! \( -s $x -ge A800.prn -a -s $x -le A899.prn \) ]
then

I want to select files that are NOT in these ranges:
A600.prn to A699.prn
A800.prn to A899.prn
 
try something like this:
Code:
case $x in
A[68]???.prn) : Do nothing;;
*) [ -s $x ] && Do something;;
esac
Anyway, man test to realize the syntax error.

Hope This Help
PH.
 
#!/usr/bin/ksh

if [[ $x != A[68][0-9][0-9].prn ]]
then
echo string does not match pattern
fi
 
Sorry for the typo, 2 ?s are sufficient.

Hope This Help
PH.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top