Skip to main content
added 46 characters in body
Source Link
Petr Skocik
  • 29.6k
  • 18
  • 90
  • 154

YouIn shell that support <() (bash, ksh, zsh), you can transform

$ cmd1 | cmd2 

into

$ cmd2 < <(cmd1)

These two should be equivalent in terms of piping. (However, I think there are some minor differences in terms of how the two forms handle things like process group and signals).

For better command line editing, I recommend you explore your shell's facilities for that. E.g., bash has set -o vi which allows you to use vi-like shortcuts or switch into vim directly to edit your command more efficiently. The default set -o emacs uses emacs shortcuts (search man bash for readline to learn more about them (/readline)).

You can transform

$ cmd1 | cmd2 

into

$ cmd2 < <(cmd1)

These two should be equivalent in terms of piping. (However, I think there are some minor differences in terms of how the two forms handle things like process group and signals).

For better command line editing, I recommend you explore your shell's facilities for that. E.g., bash has set -o vi which allows you to use vi-like shortcuts or switch into vim directly to edit your command more efficiently. The default set -o emacs uses emacs shortcuts (search man bash for readline to learn more about them (/readline)).

In shell that support <() (bash, ksh, zsh), you can transform

$ cmd1 | cmd2 

into

$ cmd2 < <(cmd1)

These two should be equivalent in terms of piping. (However, I think there are some minor differences in terms of how the two forms handle things like process group and signals).

For better command line editing, I recommend you explore your shell's facilities for that. E.g., bash has set -o vi which allows you to use vi-like shortcuts or switch into vim directly to edit your command more efficiently. The default set -o emacs uses emacs shortcuts (search man bash for readline to learn more about them (/readline)).

Source Link
Petr Skocik
  • 29.6k
  • 18
  • 90
  • 154

You can transform

$ cmd1 | cmd2 

into

$ cmd2 < <(cmd1)

These two should be equivalent in terms of piping. (However, I think there are some minor differences in terms of how the two forms handle things like process group and signals).

For better command line editing, I recommend you explore your shell's facilities for that. E.g., bash has set -o vi which allows you to use vi-like shortcuts or switch into vim directly to edit your command more efficiently. The default set -o emacs uses emacs shortcuts (search man bash for readline to learn more about them (/readline)).