Tips/잡다구리

[shell script] log.sh

dextto™ 2020. 1. 14. 10:59

- 인자가 없으면 그냥 로그파일을 출력
- 인자가 있으면 로그 파일에 인자를 grep 해서 출력

#!/usr/bin/env bash
if [ $# -eq 0 ] ; then
  tail -f /app/log/debug.log
else
  tail -f /app/log/debug.log |grep $1 --color=always
fi
반응형