whats is the meaning of using exec and then read in ksh script

。_饼干妹妹 提交于 2019-12-11 19:48:29

问题


THe script is like exec 8< $SEQ_FILE read -u8 DATE SEQ_NUMBER Can you please help me in understanding what this means?


回答1:


The exec 8< $SEQ_FILE opens the file $SEQ_FILE for reading and associates it with file descriptor 8. All further commands can then read from that file descriptor.

The command read -u8 DATE SEQ_NUMBER then does exactly that. It reads one line from that file and puts the line into two variables (split according to shell rules, typically at a space).



来源:https://stackoverflow.com/questions/21753477/whats-is-the-meaning-of-using-exec-and-then-read-in-ksh-script

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!