alias endofsleep='_() { while IFS= read a; do cmd_pid=$(awk "{print \$1}" <<< "${a}"); cmd_line=$(sed "s/^${cmd_pid} *//" <<< "${a}"); echo "Command:${cmd_line}, Pid:${cmd_pid}, Ends:$(date -d "@$(($(date -d"$(ps -o lstart= -p${cmd_pid})" +%s)+${1}))")"; done< <(ps -eo pid,cmd | grep "[s]leep ${1}$"); }; _'
No comments:
Post a Comment