#!/bin/bash if [[ "$1" == */* ]]; then echo "Invalid log file name" exit 1 fi if [ -f "/var/log/user/$1" ]; then cat /var/log/user/$1 else echo "No such log file" fi