Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save gb-swatanabe/6239457 to your computer and use it in GitHub Desktop.
Save gb-swatanabe/6239457 to your computer and use it in GitHub Desktop.
readに渡す前にsedで行頭に文字を追加しているのは、xに読み込まれたとき行頭の空白文字列が消えてしまうことへの対処です
$ ping x.x.x.x | sed -le 's/^/] /' | while read x; do echo "`date '+[%T'`$x"; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment