I have the following Bash Script:
#!/bin/bash
cd ~/Library/Developer/CoreSimulator/Devices/;
files=$(find . -name iaGambro_gambro.sql)
select file in $files; do
if [ -n "$files" ]; then
sudo sqlite3 -header -column "${file}"
fi
break
done
It should return the following 2 results:
1) ./2EFF5EBF2B2D/Library/Private Documents/iaGambro_gambro.sql
2) ./A1AF3463BFD2/Library/Private Documents/iaGambro_gambro.sql
But it is is returning the following 4 because of the white space in Private Documents
:
1) ./2EFF5EBF2B2D/Library/Private
2) Documents/iaGambro_gambro.sql
3) ./A1AF3463BFD2/Library/Private
4) Documents/iaGambro_gambro.sql
How do I get the select to recognize the paths with the spaces?
NOTE: I'm looking for how to execute on the given path, not just print it out
: Do something with "$file"
is sudo code? – Seth McClaine May 04 '15 at 15:40"$file"
– cuonglm May 04 '15 at 15:41