Note: The archives category content is an automatically generated focus channel and does not neccessarily reflect the opinions of this blog. No responsibility is taken for the external links presented here, follow at your own discretion.
The archives content is never scraped from sites - but an abstract obtained from search engines.
| Problem |
Solution |
Example |
Reference |
Recommended |
[[ $(echo $var | grep -ic "pattern") -eq 0 ]] & You could also go for "-eq 1" - does contain: [[ $(echo $var | grep -ic "pattern") -eq 1 ]] & Or "-ne 0" for same, etc. [[ $(echo $var | grep -ic "pattern") -ne 0 ]] & Plus you could use || for "or" either in place of "&&" or after this block - same as if .. then "positive" else "negative" fi. [[ $(echo $var | grep -ic "pattern") -eq 0 ]] || { echo "var does contain pattern" }
|
Leave a Reply