I have a following bash script I encountered on the web that prints the power set of a given lines of elements.
p() { [ $# -eq 0 ] && echo || (shift; p "$@") |
while read r ; do echo -e "$1 $r\n$r"; done }
after the first &&
there is echo
that does not have any argument.
Here is the code to test it:
p $(echo -e "1\n2\n3")