*bangs head on monitor*
There must be some way to do this, but I can't seem to find it. For purely educational reasons, I am trying to figure out how to pass multiple-word parameters, i.e. "This is me", to a bash script, and have it evaluate correctly.
Inside the script, echoing $1 prints out "This is me" correctly, but the variable is not valid in if statements.
$ cat ./testscript.sh
#!/bin/bash
echo $1
if [ $1 = "This is me" ]; then
echo "Yay"
else
echo "No..."
fi
$ ./testscript.sh "This is me"
This is me
./testscript.sh: line 4: [: too many arguments
No...
Escaping the spaces (./testscript.sh "This\ is\ me") doesn't seem to work, and I'm not sure what else to try
Thanks!