howto:redirection_tutorial

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
howto:redirection_tutorial [2016/09/08 15:05]
anwar [exec] there should be only one echo
howto:redirection_tutorial [2019/02/23 04:01]
razzed
Line 21: Line 21:
 # lsof +f g -ap $BASHPID -d 0,1,2 # lsof +f g -ap $BASHPID -d 0,1,2
 COMMAND ​  PID USER   ​FD ​  TYPE FILE-FLAG DEVICE SIZE/OFF NODE NAME COMMAND ​  PID USER   ​FD ​  TYPE FILE-FLAG DEVICE SIZE/OFF NODE NAME
-bash    12135 root    0u   ​CHR ​    RW,LG 136,​13 ​     0t0   16 /dev/pts/13 +bash    12135 root    0u   ​CHR ​    RW,LG 136,​13 ​     0t0   16 /dev/pts/5 
-bash    12135 root    1u   ​CHR ​    RW,LG 136,​13 ​     0t0   16 /dev/pts/13 +bash    12135 root    1u   ​CHR ​    RW,LG 136,​13 ​     0t0   16 /dev/pts/5 
-bash    12135 root    2u   ​CHR ​    RW,LG 136,​13 ​     0t0   16 /dev/pts/13+bash    12135 root    2u   ​CHR ​    RW,LG 136,​13 ​     0t0   16 /dev/pts/5
 </​code>​ </​code>​
  
Line 56: Line 56:
  
 the ''>​ file''​ after the command alters the file descriptors belonging to the the ''>​ file''​ after the command alters the file descriptors belonging to the
-command ​foo. It changes the file descriptor ''​1''​ (''>​ file''​ is the same as+command ​''​echo''​. It changes the file descriptor ''​1''​ (''>​ file''​ is the same as
 ''​1>​file''​) so that it points to the file ''​file''​. They will look like: ''​1>​file''​) so that it points to the file ''​file''​. They will look like:
  
  • howto/redirection_tutorial.txt
  • Last modified: 2019/02/23 04:49
  • by razzed