I would like to do something similar to the following:
which someapplciation | cd outputfrompreviouscommand
The command which provides a directory and I would like to be able to make that output my current working directory without using a programming language i.e. awk, bash, perl, etc. and to only use the pipe command.
To further give an example:
which vi
provides the output
/some/dir
I would like my working directory to be moved to that directory which I can test by using the pwd command which should have the output that matches of /some/dir.
which executableprovides the output/path/to/executable, not its directory. So,cding to the output ofwhichwon't work. – HalosGhost Jun 10 '14 at 22:57