Solved

Wild care a condition

Posted on 2014-01-27
4
187 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Utilizing an array to gracefully append to a list of EmailAddresses
Part One of the two-part Q&A series with MalwareTech.
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

623 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