User Tools

Site Tools


os_cp:redirects_pipes

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Last revision Both sides next revision
os_cp:redirects_pipes [2023/03/31 15:22]
jkonczak [cut]
os_cp:redirects_pipes [2024/03/19 23:23]
jkonczak [The details]
Line 220: Line 220:
 | ''>>''​ | opens //word// for appending and replaces //​file_number//​ with the file | | ''>>''​ | opens //word// for appending and replaces //​file_number//​ with the file |
 | ''<>''​ | opens //word// for reading and writing and replaces //​file_number//​ with the file | | ''<>''​ | opens //word// for reading and writing and replaces //​file_number//​ with the file |
-| ''<<''​ | 1) creates a temporary file \\ 2) reads an input line \\ 3) if the line is //​word//, ​go to step \\ 4) if there are no quotes (a pair of ''"''​ or <​html><​code>'</​code></​html>​) ​in //word//, performs the expansion((E.g.,​ ''​$VAR''​ is substituted with its value, ''​`date`''​ is replaced by output of the date command etc.)) on the line \\ 5) writes ​the line to the temporary file \\ 6) opens the temporary file for reading ​ \\ 7) replace //​file_number//​ with the file \\ The command is run once this is done |+| ''<<''​ | 1) creates a temporary file \\ 2) reads an input line \\ 3) if the line is //​word//, ​goes to step \\ 4) if there are no quotes (a pair of ''"''​ or <​html><​code>'</​code></​html>​) ​enclosing the //word//, performs the expansion((E.g.,​ ''​$VAR''​ is substituted with its value, ''​`date`''​ is replaced by output of the date command etc.)) on the line \\ 5) appends ​the line to the temporary file \\ 6) goes to step 2 \\ 7) opens the temporary file for reading ​ \\ 8) replace //​file_number//​ with the file \\ The command is run once this is done |
 | ''<<​-''​| same as ''<<'',​ but after step 2 adds a step: \\ 2a) erase all leading tab characters (''​\t''​) \\ warning: spaces are not erased | | ''<<​-''​| same as ''<<'',​ but after step 2 adds a step: \\ 2a) erase all leading tab characters (''​\t''​) \\ warning: spaces are not erased |
 | ''<<<''​| warning: this is a Bash extension \\ 1) creates a temporary file \\ 2) writes //word// to it \\ 3) writes a newline to it \\ 4) opens the temporary file for reading ​ \\ 5) replace //​file_number//​ with the file \\ The command is run once this is done | | ''<<<''​| warning: this is a Bash extension \\ 1) creates a temporary file \\ 2) writes //word// to it \\ 3) writes a newline to it \\ 4) opens the temporary file for reading ​ \\ 5) replace //​file_number//​ with the file \\ The command is run once this is done |
-| ''<&''​ | if //word// is a number: duplicates a readable descriptor number //word// to the number //​file_number//​ \\  if //word/// is ''​-'':​ closes a descriptor number //​file_number//​ | +| ''<&''​ | if //word// is a number: duplicates a readable descriptor number //word// to the number //​file_number//​ \\  if //word// is ''​-'':​ closes a descriptor number //​file_number//​ | 
-| ''>&''​ | if //word// is a number: duplicates a writeable descriptor number //word// to the number //​file_number// ​ \\  if //word/// is ''​-'':​ closes a descriptor number //​file_number//​ |+| ''>&''​ | if //word// is a number: duplicates a writeable descriptor number //word// to the number //​file_number// ​ \\  if //word// is ''​-'':​ closes a descriptor number //​file_number//​ |
 | ''&>''​ | warning: this is a Bash extension \\ warning: this does not allow providing //​file_number//​ (in fact, ''&''​ is the file number) \\ opens //word// for writing, truncates it and replaces streams 1 and 2 with the file | | ''&>''​ | warning: this is a Bash extension \\ warning: this does not allow providing //​file_number//​ (in fact, ''&''​ is the file number) \\ opens //word// for writing, truncates it and replaces streams 1 and 2 with the file |
 | ''&>>''​| warning: this is a Bash extension \\ warning: this does not allow providing //​file_number//​ (in fact, ''&''​ is the file number) \\ opens //word// for appending and replaces streams 1 and 2 with the file | | ''&>>''​| warning: this is a Bash extension \\ warning: this does not allow providing //​file_number//​ (in fact, ''&''​ is the file number) \\ opens //word// for appending and replaces streams 1 and 2 with the file |
os_cp/redirects_pipes.txt · Last modified: 2024/03/19 23:33 by jkonczak