Solved

Wild care a condition

Posted on 2014-01-27
4
183 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
t-sql sp_addlinkedserver possible risks 3 70
Need some help with powershell script 5 50
Math Equation 23 88
[SQL server / powershell] bulk delete table from CSV 8 33
I hope you'll find this tutorial useful and interesting. So let's try to extend Tcl with a new package.  For anyone more deeply interested please check out the book "Practical Programming in Tcl and Tk". It's really one of the best written books abo…
Recently, an awarded photographer, Selina De Maeyer (http://www.selinademaeyer.com/), completed a photo shoot of a beautiful event (http://www.sintjacobantwerpen.be/verslag-en-fotoreportage-van-de-sacramentsprocessie-door-antwerpen#thumbnails) in An…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
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.

809 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