Here is the command in question
find . -name "*.txt" | xargs -Ifile sh -c 'echo $(basename $1) ' -- file
So without the double dash the
file is not passed to
sh and then get recognized as
$1. Why is that? I know that
-- prevents the consequent argument from being recognized as command line options. But since
file is not prepended with a dash, it seems as though there is no reason for it to get recognized as a command line option.