Tagged Questions
19
votes
6answers
1k views
Why can't I redirect a path name output from one command to “cd”?
I am trying to get cd to accept a directory name redirected to it from another command. Neither of these methods work:
$ echo $HOME | cd
$ echo $HOME | xargs cd
This does work:
$ cd $(echo $HOME)
...
3
votes
2answers
333 views
Behavior of stdin/stdout in conjunction with subshells and cd command
I have the following series of commands:
cd / && ls | ( cd /tmp && cat >dumpfile)
This series of commands does the following: it creates a file named /tmp/dumpfile. This file ...