Is there a way to actually execute results from a shell command, instead of using them as arguments to another command?
For instance, I'd like to run '--version' on all executables in a folder, something like:
ls /usr/bin/ | --version
I've found a way using find/exec:
find /usr/ -name valgrind -exec {} --version \;
But I'd like to do it with ls. I've search for over 45 minutes and can't find any help.
/usr/bin
that isn't executable, or that is a directory. – Gilles 'SO- stop being evil' Oct 24 '16 at 00:07/usr/bin
but you never know and, in any case,ls
isn't the right too for the job. – terdon Dec 08 '16 at 23:38