Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
sandreas
· 5y ago · 0 comments
Mmh, what do you mean with "preserve"...? `cd -` works like a charm for me.
Comments
[–]
makeworld
5y 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.
[–]
sandreas
OP
5y ago
Aah, now I see. Awesome, I'll try that out. Thank you.