I want to take the output of simple.sh
, a script from the internet and check its exit code. I on OSX
#!/bin/bash
$(curl -s http://127.0.0.1:8000/simple.sh)
if [ -z "$?" ]; then
echo "Good"
exit 0
else
echo "Bad"
exit 1
fi
simple.sh:
#!/bin/bash
exit 0
The problem I am getting is:
./test.sh: line 2: #!/bin/bash: No such file or directory
Bad
curl
, i.e. the output fromtype curl
. Probably a path issue. – 111--- Mar 13 '19 at 0:45eval "$(curl ...)"
– Yunus Mar 13 '19 at 1:57