1 2 3 4
#!/sbin/sh SERV_NAME=$(echo "$1" | sed 's/\/log$//') [ -f /var/log/"$SERV_NAME"/current ] && tac /var/log/"$(echo "$1" | sed 's/\/log$//')"/current | less || echo "Cannot read log"