Here is the puzzle: can someone explain why it cd
fails when the output is redirected to the channel?
eg:.
james@machine:~$ cd /tmp
james@machine:~$ cd /tmp | grep 'foo' # doesn't work
james@machine:~$ cd /tmp | tee -a output.log
james@machine:~$ cd /tmp >out.log
Tested on OSX, Ubuntu and RHEL.
Any ideas?
EDIT : It seems strange that I am collecting a conclusion cd
? The reason is because it is from a function that wraps arbitrary shell commands with log entries and output processing.
source
share