I was testing a Bash script that accepts random arguments and noticed that it would say something like
./Var: line 19: [three: command not found
Here is a minimal working example:
#!/bin/bash
$1 $2 $3
echo "The first argument does $1"
if [$1 >= 2]; then
echo "$1 has 2 words"
else
echo "$1 has unknown amount of words"
fi
#^First
echo "The second argument does $2"
if [$2 >= 2]; then
echo "$2 has 2 words"
else
echo "$2 has unknown amount of words"
fi
#^Second
echo "The third argument does $3"
if [$3 >= 2]; then
echo "$3 has 2 words"
fi
#^Third
But it would continue to run the script, is there a way i can have it run without the "command not found" appearing? Or is this just an issue within my code that is making it do this?