Solved

Wild care a condition

Posted on 2014-01-27
4
176 Views
Last Modified: 2014-01-27
How do I wild card a condition,

This is what I have,

 if [[ ${PRINTER} = "*proc*" ]]

Is this correct?
0
Comment
Question by:bje
  • 2
4 Comments
 
LVL 84

Expert Comment

by:ozo
ID: 39812083
if [[ ${PRINTER} =~ "proc" ]]
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 39812095
If your shell doesn't support the above try

if echo $PRINTER | grep -q "proc"; then ...
0
 
LVL 84

Accepted Solution

by:
ozo earned 350 total points
ID: 39812099
if [[ ${PRINTER} == *proc* ]]
0
 

Author Closing Comment

by:bje
ID: 39812149
This worked great.  Thanks.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

It is a general practice to get rid of old user profiles on a computer  in a LAN environment. As I have been working with a company in a LAN environment where users move from one place to some other place at times. This will make many user profil…
Utilizing an array to gracefully append to a list of EmailAddresses
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now