First page Back Continue Last page Overview

 

Handling Filenames with Spaces

 
  • Bash mis-interprets spaces in filenames

    • Space treated as filename-delimiter by default
    • “my file” interpreted as two files: my and file
  • IFS environment variable can be used to specify an alternate (or no) delimiter

    • Always reset after changing OLD_IFS=$IFS # Backup old delimeter IFS=$(echo) # Set empty delimeter <code> # Do stuff IFS=$OLD_IFS # Restore IFS