I have unclear information about word splitting in Shell and subshells.
Example:
IFS=""
file_name="file with space"
file_name=$(real_path $file_name)
Will $file_name
get split in subshell? Or do I have to double-quote it like so:
file_name=$(real_path "$file_name")
After some testing I found out that:
- if I set
IFS=" "
, then$file_name
gets split by spaces - if
IFS=""
then whole$file_name
is passed as first parameter.
ksh, dash, and bash all show this behavior so far.