Here's what I'm trying to do (in a script):
#!/usr/bin/env bash
if [[ ! $("/usr/bin/scp [email protected]:/Users/seamus/Downloads/imgutils/image-utils* /home/pi/testscp") ]]; then
printf "\nERROR & EXIT: 'scp' failed \n"
exit 1
fi
printf "success!\n"
I've tried doing this in a few ways, but nothing seems to work. Here's what I get from the above:
./testscp.sh: line 3: /usr/bin/scp [email protected]:/Users/seamus/Downloads/imgutils/image-utils* /home/pi/testscp: No such file or directory
ERROR & EXIT: 'scp' failed
The scp command runs OK when it's on a line by itself. If I do that, I can test for $0 - which works OK... but I'd prefer to do it all in a single line. What am I missing?