Last active
January 9, 2017 02:32
-
-
Save tsuyoshicho/9ceb84dab180cb862b89 to your computer and use it in GitHub Desktop.
シェルスクリプトでのLTSV出力イディオム ref: http://qiita.com/tsuyoshi_cho/items/4371c94e4e86b8406053
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cat << EOS | tr '\n' '\t' | sed -e 's/\t*$//' >> ${log} | |
name:${app} | |
time:$(date --iso-8601=seconds) | |
pid:$$ | |
args:"${*}" | |
EOS | |
echo "" >> ${log} | |
# このスクリプトで、ログには自分自身(の名前/)PIDを出しているが | |
# 実行した(コマンド名/)ステータス/PIDとするなら以下のような行を入れる | |
# 直前に実行したコマンド(同期実行)のステータス(ex test -f <file>) | |
status:$? | |
# 直前に実行したコマンド(非同期実行)のPID(ex.make &) | |
pid:$! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment