i am trying to make a very simple bash script to find files matching the given name in the directory structure of the current directory. So, I used the find function like this
ARGS=1
E_BADARGS=65
E_NOFILE=66
if [ $# -ne "$ARGS" ] # Correct number of arguments not passed
then
echo "Usage: `basename $0` filename"
exit $E_BADARGS
fi
echo `find ./ -type f -name \$1`
this works fine but unlike when I use the find command in the command line, the resulting file paths are not separated by newline but just by a space. This naturally isn't too easy to see in the screen. How can I echo so that each file it finds will be separated by a newline.