eval: execute all shell replacement before issue the command.
ivan@Maintenance_Center:~$ set a b c d
ivan@Maintenance_Center:~$ eval echo The last argument is \$$#
The last argument is d
ivan@Maintenance_Center:~$ echo The last argument is \$$#
The last argument is $4
ivan@Maintenance_Center:~$
exec: open or close the standard input or output.
#!/bin/bash
exec < /tmp/file #open the /tmp/file
while read line;do
echo ${line}
done
#will print file /tmp/file
if you want read from terminal after you close standard input you should specify the optional input
read answer < /dev/tty
阅读(1432) | 评论(0) | 转发(0) |