• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 212
  • Last Modified:

Wild care a condition

How do I wild card a condition,

This is what I have,

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

Is this correct?
0
bje
Asked:
bje
  • 2
1 Solution
 
ozoCommented:
if [[ ${PRINTER} =~ "proc" ]]
0
 
woolmilkporcCommented:
If your shell doesn't support the above try

if echo $PRINTER | grep -q "proc"; then ...
0
 
ozoCommented:
if [[ ${PRINTER} == *proc* ]]
0
 
bjeAuthor Commented:
This worked great.  Thanks.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now