earthbound19 / _ebDev

Various tools, mostly custom-made for art development.
2 stars 2 forks source link

fix IFS in iteration / array create where path names could have spaces #132

Open earthbound19 opened 1 year ago

earthbound19 commented 1 year ago

Some .sh scripts may have IFS reassignments that miss multiple spaces in directories, and which concatenate them to one. ftun.sh had this. To fix that, do IFS reassignment and revert like this:

OIFS="$IFS"
IFS=$""
  paths=($(find . -type d))
IFS="$OIFS"

Check all scripts for and fix this if needed.

NOTE: I'm not sure what $"" does and need to look it up / test it. In many scripts I have the reassignment as IFS=$'\n' and need to look up what that does also. Copy/pasted code :|