#!/bin/bash set -o noglob input=$1 input=$(echo $input | sed -r 's/^.*[\W\s](src\/[\W.\/]+)[\W\s]*/\1/') input=$(echo $input | sed 's/[^[:alpha:]]\+$//') if [ "$input" == "" ]; then exit fi if [[ "$input" =~ ^src/ ]]; then echo -n "Checking $input .. " if [ -f $input ]; then echo file exists else if [ -d $input ]; then echo directory exists else echo does not exist fi fi fi