Bash - Scope

Card Puncher Data Processing

About

A name variable or function is scoped in Bash:

  • by the subshell
  • with the export built-in command
  • with the source built-in command
  • as part of the command. Example with IFS on looping over a PATH variable separated with : semi-colon
while IFS=':' read -r A_PATH; do
   echo "$A_PATH"
done <<< "$MY_PATH"







Share this page:
Follow us:
Task Runner