How to use pipes to reference stdout of a command from within the stdin of another?

view full story

http://askubuntu.com – I am trying to understand how to use the stdout as the stdin of another command. To test it, I am trying to use the following command to delete all directories from the current folder. ls -d -- */ | rm -rf $1 I would expect the result of ls -d -- */ to be piped into the input of the rm, but it does not work. Ideas? (HowTos)