Skip to content

Instantly share code, notes, and snippets.

@arc279
Last active April 27, 2017 08:05
Show Gist options
  • Save arc279/b1e7156869a7aff2bc23f434b19f4d6b to your computer and use it in GitHub Desktop.
Save arc279/b1e7156869a7aff2bc23f434b19f4d6b to your computer and use it in GitHub Desktop.
入力を複数の名前付きパイプに流して最後に結合する
#!/bin/bash
rm -rf f1 f2
mkfifo f1
mkfifo f2
cat $0 | tee >(tac | cat -n > f1) >(cat -n > f2) >/dev/null
paste f1 f2 -d $'\n'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment