#!/bin/sh # Can we check to see if we had an argument? if [ $# -le 0 ] then echo "Usage: ./script_if " exit fi # The arguments to the script are $1, $2, etc. if cat /var/log/nginx/access.log | grep $1 | grep iPhone > /dev/null then echo Somebody looked at $1 with an iPhone else echo Nobody looked at $1 with an iphone fi