CuteFuzzyPuppy
Cadet
- Joined
- Sep 26, 2015
- Messages
- 6
Hello,
I'm posting this here instead of the Help & Support forum because it's not really a FreeNAS question. I know next to nothing about programming/scripting but so far I have been able to google my way through most problems, but this one has me stumped.
I have a variable, $var, that's a string and I want to search that string to see if it contains another string. Here's what I have tried to far:
if [ "$var" == *string*]
then
I've also tried this and a few other things:
if [ "$var" == *"string"*]
then
I'm sure that it's a simple fix but I haven't been able to figure it out. I would greatly appreciate any help and if anyone has a good resource on learning shell scripting I would love to read it. Thanks!
I'm posting this here instead of the Help & Support forum because it's not really a FreeNAS question. I know next to nothing about programming/scripting but so far I have been able to google my way through most problems, but this one has me stumped.
I have a variable, $var, that's a string and I want to search that string to see if it contains another string. Here's what I have tried to far:
if [ "$var" == *string*]
then
I've also tried this and a few other things:
if [ "$var" == *"string"*]
then
I'm sure that it's a simple fix but I haven't been able to figure it out. I would greatly appreciate any help and if anyone has a good resource on learning shell scripting I would love to read it. Thanks!