Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Wild care a condition

Posted on 2014-01-27
4
Medium Priority
?
195 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 85

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 85

Accepted Solution

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

Author Closing Comment

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

Featured Post

Independent Software Vendors: 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

This article will show, step by step, how to integrate R code into a R Sweave document
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
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)
Suggested Courses
Course of the Month8 days, 15 hours left to enroll

876 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