Your script is using $1
, so that is the first result in the list. If you want to print all results you could use:
#!/bin/bash
printf "%s\n" "$@"
Also, you do not need xargs
, you could use
find . -iname "*.java" -exec ./fnfs2lc.sh {} +
If you use the less efficient
find . -iname "*.java" -exec ./fnfs2lc.sh {} \;
Then you could use
echo "$1"
But note the quotes around $1