Using the results of a command of as a variable is pretty easy. Just use the venerable $(some command), as in this simple example: for i in $(ls | grep -v badpattern); do   mv $i $i.bak done But what if you want to use the results of multiple commands as file inputs to another command?…