#! /bin/bash # # exists - script that tests if a file exists and prints message # This script takes one argument. # #First check if an argument was passed if [ -z $1 ]; then echo "no argument passed" else #Check if file exists if [ -e $1 ]; then echo "File exists: $1" else echo "File does not exist: $1" fi fi