什么是使用exec然后在ksh脚本中读取的含义 [英] whats is the meaning of using exec and then read in ksh script

查看:97
本文介绍了什么是使用exec然后在ksh脚本中读取的含义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

脚本就像 exec 8< $ SEQ_FILE 读取-u8 DATE SEQ_NUMBER 您能帮我理解这意味着什么吗?

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

推荐答案

exec 8< $SEQ_FILE打开文件$SEQ_FILE进行读取,并将其与文件描述符8关联.然后,所有其他命令都可以从该文件描述符中读取.

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.

然后,命令read -u8 DATE SEQ_NUMBER正是这样做的.它从该文件读取一行并将其放入两个变量(根据shell规则拆分,通常在空格处拆分).

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).

这篇关于什么是使用exec然后在ksh脚本中读取的含义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆