Skip to main content
7 of 8
deleted 26 characters in body
Pourko
  • 1.9k
  • 10
  • 29

In Bash, I'd do it this way:

[ -v IFS ] && oldIFS="$IFS" || unset oldIFS IFS=something some commands [ -v oldIFS ] && IFS="$oldIFS" 

or this way:

[ "${IFS+set}" ] && oldIFS="$IFS" || unset oldIFS IFS=something some commands [ "${oldIFS+set}" ] && IFS="$oldIFS" 
Pourko
  • 1.9k
  • 10
  • 29