[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 201
  • 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

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

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