Bash Word splitting

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!


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


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


  • 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

Got any Bash Question?