Timeline for removing duplicates from pushd/popd paths
Current License: CC BY-SA 3.0
6 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Dec 6, 2019 at 18:32 | comment | added | Keith Thompson |
Also, in your pushd() function, the builtin pushd command prints the directory stack. In this case, it will print the stack before it's de-duplicated. Suggested change: pushd() { builtin pushd "$@" >/dev/null ; dedup ; dirs ; } (not tested).
|
|
| Dec 6, 2019 at 15:32 | comment | added | meuh |
It doesn't seem to be necessary with bash in the particular case of an index in array[index]=..., but you are right that in general you should double-quote variables, and there is no harm in doing so in this case.
|
|
| Dec 6, 2019 at 1:24 | comment | added | Keith Thompson |
I suggest adding double quotes around $PWD and $v, in case you have directory names with spaces in them (lamentably common on some systems).
|
|
| Jun 8, 2016 at 22:09 | vote | accept | dreftymac | ||
| Jun 8, 2016 at 20:23 | history | edited | meuh | CC BY-SA 3.0 |
added 146 characters in body
|
| Jun 8, 2016 at 20:07 | history | answered | meuh | CC BY-SA 3.0 |