Can someone please tell me what is wrong with this shellscript? I need to use wildcards because my numbers will be random. My number will be an ip address when I get the syntax right. I would think when I run this I would get the first case and I would see this output.
VAR1 is 123
----------
Users cannot control this device.
VAR1 is 123
Unfortunately I see this output.
VAR1 is 123
----------
I like cookies
VAR1 is 123
#!/bin/bash
VAR1=123
echo VAR1 is $VAR1
echo ----------
if [ $VAR1 = [0-9][0-9][0-9] ]; then
#if [ $VAR1 = 131.247.2.211 ]; then
echo $"Users cannot control this device." >&2
echo VAR1 is $VAR1
exit 1
else
echo $"I like cookies" >&2
echo VAR1 is $VAR1
fi