摘要: #!/bin/bash# reassign-stdout.shLOGFILE=logfile.txtexec 6>&1 # Link file descriptor #6 with stdout. # Saves stdout.exec > $LOGFILE # stdout replaced with file "logfile.txt".# ----------------------------------------------------------- ## All output from commands in this block sent 阅读全文
posted @ 2011-06-05 21:40 greencolor 阅读(167) 评论(0) 推荐(0) 编辑
摘要: #!/bin/bash# Redirecting stdin using 'exec'.#exec 6<&0 # Link file descriptor #6 with stdin. # Saves stdin.exec 0< data-file # stdin replaced by file "data-file"read a1 # Reads first line of file "data-file".read a2 # Reads second line of file "data-file.&q 阅读全文
posted @ 2011-06-05 21:24 greencolor 阅读(200) 评论(0) 推荐(0) 编辑