BashWord splitting


Syntax

  • Set IFS to newline: IFS=$'\n'
  • Set IFS to nullstring: IFS=
  • Set IFS to / character: IFS=/

Parameters

ParameterDetails
IFSInternal field separator
-xPrint commands and their arguments as they are executed (Shell option)

Remarks

  • Word splitting is not performed during assignments e.g newvar=$var
  • Word splitting is not performed in the [[ ... ]] construct
  • Use double quotes on variables to prevent word splitting