How can I use the stdout of the echo command as an argument in a for loop.
echo NUMBER | for i in {1..$NUMBER}; do if [ $(( $i % 2 )) -eq 0 ]; then echo "even"; fi; done
In this example, I wish to loop over a sequence of numbers with a length equal to the integer outputted by echo. How can I do this in a single command line?