Why doesn't this work?
find . -maxdepth 1 -type f -print0 | xargs -0 .
All I get is xargs: .: Permission denied
.
When you run . file
, you invoke a the shell builtin .
. Your xargs
variant tries to execute the current directory.
Even if that did invoke the builtin, that command runs in a subshell, so all the "sourcing" would be useless.
Use shell globbing and a loop for that:
for file in * ; do
if [ -f "$file" ] ; then
. "$file"
fi
done
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With