Feeling like an idiot right now. Why does this not work?
echo "/some/directory/path" | xargs -n1 cd
The pipe runs xargs in a subprocess, and xargs runs cd in a subprocess. Changes in a subprocess do not get propagated to the parent process.
cd `echo "/some/directory/path" | cut -d\ -f1`
Sign up using Google
Sign up using Facebook
Sign up using Stack Exchange
By posting your answer, you agree to the
terms of service.
2 years ago
1 year ago