Solved

Wild care a condition

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Awk : two files math 8 27
LINUX Field Separators 7 55
Replacing multiple embedded commas in a CSV file with sed 10 23
add if statement powershell 8 16
Having just graduated from college and entered the workforce, I don’t find myself always using the tools and programs I grew accustomed to over the past four years. However, there is one program I continually find myself reverting back to…R.   So …
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
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.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

685 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