I need to check the command executed is success or not, I have place the below code in test.sh run it, which give the out by listing the content of /home
but there is a warning
./test.sh: 3: ./test.sh: [[: not found
What's wrong in below command
#!/bin/sh
ls /home/
if [[ "$?" != 0 ]]; then
echo "Commnad Error"
else
echo "Commnad Success"
fi
ls /home 2>/dev/null || echo "Command Error"
. ` – Valentin Bajrami Dec 05 '16 at 14:12