How would you represent EOF in bash?

前端 未结 5 1089
执念已碎
执念已碎 2020-12-24 07:31

I\'m trying to do something like

read -d EOF stdin

for word in $stdin; do stuff; done

where I want to replace \'EOF\' for an actual repre

5条回答
  •  猫巷女王i
    2020-12-24 08:11

    Two things...

    The EOF character is represented by C-d (or C-v C-d if you want to type it), but to do what you're trying, it's better to do this:

    while read line; do stuff "${line}"; done
    

提交回复
热议问题