I'm stuck in a syntax lack; tried multiple ways but I somehow don't see the solution. I'm sure it's super simple, but I currently just don't get it.
Goal
Split the QUEUE_STRING into 2 parameters, check the first for equality with one of 2 strings, add the second in another commandline call
What I've got so far
#!/bin/sh
QUERY_STRING="setSize&10240000"
arr=${QUERY_STRING//&/ }
if [ $arr[0] = "status" ]; then
echo "YES"
./myApp status
elif [ $arr[0] = "setSize" ] ; then
echo "NO"
./myApp setSize $arr[1]
else
echo "ERROR"
fi
I just get "error" but I should receive "NO"
Thanks for your help
set -x(usually )right after the first line, so you actually see what your script is doing when executing it. This will always give you an insight on what might be wrong.