Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

IFS needs some care and attention and read should have -r.

    $ ls -Q
    "   spaces   "
    $ ls | while IFS="\n" read -r f; do ls "$f"; done
       spaces   
    $
For lots of grim detail see David A. Wheeler's http://www.dwheeler.com/essays/fixing-unix-linux-filenames.h...


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: