Redirect Operators and File Descriptors

<&n redirect standard input from file descriptor n
>&n redirect standard output to file descriptor n
n<file redirect file descriptor n from file
n>file redirect file descriptor n to file
n>>file redirect file descriptor n to file. Create file if non-existent, else overwrite.
n>| file redirect file descriptor n to file. Create file even if noclobber is enabled.
n<&m redirect file descriptor n input from file descriptor m
n>&m redirect file descriptor n output to file descriptor m
n<>file open file for reading and writing as file descriptor n
n<<word redirect to file descriptor n until word is read
n<<-word redirect to file descriptor n until word is read; ignore leading tabs
n<&- close file descriptor n for standard input
n>&- close file descriptor n for standard output
print &un args redirect arguments to file descriptor n. If n is greater than 2, it must first be opened with exec. If n is not specified, the default file descriptor argument is 1 (standard output).
read &un args read input line from file descriptor n. If n is greater than 2, it must first be opened with exec. If n is not specified, the default file descriptor argument is 0 (standard input).
 

猜你喜欢

转载自utel.iteye.com/blog/817549