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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

If statements equaling multiple things

Status
Not open for further replies.

jalge2

Technical User
Feb 5, 2003
105
US
Hi everyone. The script I am writing is basically moring out a file, and at the end of the file, I am asking if you would like to print the file. The problem I have is, I want my if statement to be equal to "y" or "Y". I thought it should be.


if [ $pans = "y" -o "Y" ]

then
lp -dpcl@pr7 (filename)

but it isn't working.

A little help would be nice. Thanks a lot.

Jason
Lowe's Home Improvement
 
Hi,
write if [ $pans = "y" -o $pans = "Y" ]
regards Boris
 
Amazes me that people are still using the old [] single brackets instead of the [[]] double brackets.
 
I'm just learning, so give me a little credit.
 
The [] still work, but [[]] is better. Check out the O'Reilly Korn Shell book, it's a great read. IBM Certified -- AIX 4.3 Obfuscation
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top