I am creating a script and when I try to capture a command return, I have an error of command not found, if I use this command on the terminal:
gcloud -q compute snapshots list --format='csv(NAME)'
It works fine.
The script is:
#!/bin/sh
CSV_SNAPSHOTS= $(gcloud -q compute snapshots list --format='csv(NAME)')
IFS=$'\n'
for i in $CSV_SNAPSHOTS
do
echo "$i"
done
$CSV_SNAPSHOTS
, so you should probably issue aset -o noglob
before thatfor
loop. – Stéphane Chazelas Jul 28 '16 at 14:42