Hacker News new | past | comments | ask | show | jobs | submit login

You might also want to clear IFS if you don't want to trim leading/trailing whitespace (taken from https://mywiki.wooledge.org/BashFAQ/001):

  while IFS= read -r line <&9; do
    cat > ignoredfile
    printf '%s\n' "$line"
  done 9< "$file"
("cat" is used as an example of a command eating stdin)



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

Search: