Y
Hacker News
new
|
ask
|
show
|
jobs
by
ozym4nd145
1789 days ago
This might be a better alternate to preserve functionality of `cd -`
function ..() { cd $(printf '../%.0s' $(seq 1 $1)) }
1 comments
sandreas
1789 days ago
Mmh, what do you mean with "preserve"...? `cd -` works like a charm for me.
link
makeworld
1789 days ago
"cd -" changes to the previous working directory. Your function calls cd multiple times, so calling "cd -" won't bring the user to the previous working directory they expect. ozym4nd145's function only calls cd once.
link
sandreas
1789 days ago
Aah, now I see. Awesome, I'll try that out. Thank you.
link