#!/bin/bash dir="$1" a=${dir:0:1} # take first character of the directory if [ $a != "/" ] # if the directory is not given in its full path name then dir="$(pwd)/$1" fi find "$dir" -type f | xargs P2a09.txt