SourceForge has been redesigned. Learn more.
Close

save/restore $IFS

2010-06-23
2013-03-05
  • Ken Stailey

    Ken Stailey - 2010-06-23

    How does this work?

    OIFS=$IFS
    IFS=$OIFS

    I could see it working if it was

    OIFS="$IFS"
    IFS="$OIFS"

    but without the double quotes doesn't the whitespace get discarded?

    For instance

    echo $IFS > foo
    ls -l foo | awk '{print $5}'
    1

    only one byte is not lost and that's the newline.

     
  • Ken Stailey

    Ken Stailey - 2010-06-23

    The reason I ask here is because fwbuilder generates code with that $IFS save/restore bug in it.

     
  • Vadim Kurland

    Vadim Kurland - 2010-06-23

    looks like a bug, please open bug report.  Do you see any problems that could be attributed to it ?

     

Log in to post a comment.