Timeline for bash directory shortcuts
Current License: CC BY-SA 2.5
14 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jul 17, 2018 at 21:30 | comment | added | jamesdlin |
"The downside of course is it won't work if there's a directory in your current directory named "b" -- that takes precedence over the CDPATH" ... You could use CDPATH=":~/symlinks" instead. See unix.stackexchange.com/questions/456866/…
|
|
| Jul 17, 2018 at 20:38 | comment | added | jamesdlin |
@shadyyx Use cd -P foo.
|
|
| Jun 23, 2016 at 8:54 | comment | added | shadyyx |
This solution is nice and works fine, but if I do cd foo the shell (bash) says I am exactly in ~/.symlinks/foo and not in (e.g.) /var/www/foobar/bar/f/o/o/foo... Some way how to make cd symlink follow the symlink to the end directory?
|
|
| Mar 18, 2013 at 11:40 | comment | added | etarion | There's no need to export the var. exporting it is for telling subprocesses about the value of the variable, which is not needed as it is zsh which expands the directory alias. | |
| Sep 3, 2010 at 18:14 | comment | added | Seamus | Added it to my .zshrc and that worked. | |
| Sep 3, 2010 at 18:14 | vote | accept | Seamus | ||
| Sep 3, 2010 at 16:43 | comment | added | Michael Mrozek |
@Seamus Exports are temporary and go away when the shell ends; you want to put the export commands in a file that gets auto-loaded when your shell begins, like ~/.bashrc
|
|
| Sep 3, 2010 at 14:06 | comment | added | Seamus | This works nicely, but how do I make the change permanent? If I close, and then restart the shell, it seems to forget the shortcut I made... (This might be because I haven't properly set it to be the default shell) | |
| Sep 2, 2010 at 14:00 | comment | added | Michael Mrozek |
@Seamus Not at all, M-x shell just spawns your default shell inside an emacs buffer; you interact with it just like if it were in a terminal window. M-x eshell, on the other hand, is a shell written entirely in emacs
|
|
| Sep 2, 2010 at 0:13 | comment | added | Seamus | [I'd mostly be doing this using emacs M-x shell (since that's when I use the terminal), I guess that rules out ZSH solutions]... | |
| Sep 1, 2010 at 18:34 | comment | added | Michael Mrozek | @Steven It's pretty similar, but ZSH knows it's a named directory in this case so it can treat it specially in prompt expansions and shell built-in commands | |
| Sep 1, 2010 at 17:06 | comment | added | user601 | referring the op to zsh is the right thing to do. i've not missed that feature once in 15 years. seems like the kind of thing some people get really obsessed about while others don't care. that's why there is more than one shell. | |
| Sep 1, 2010 at 16:37 | comment | added | Steven D | In what ways does this ZSH feature differ from doing: echo hi> /tmp/test;export t=/tmp; cat $t/test At least on my machine, this works just fine. The only difference is the character you have to type. | |
| Sep 1, 2010 at 16:28 | history | answered | Michael Mrozek | CC BY-SA 2.5 |