Re: Issus with popd and pushd

2017-04-18 Thread Chet Ramey
On 4/18/17 2:13 PM, L A Walsh wrote: > Chet Ramey wrote: >> On 4/18/17 9:35 AM, Eduardo Bustamante wrote: >> >> >>> Or now that I think about it, you can get away with these functions: >>> >>> # masked builtins >>> dualbus@debian:~/foo/bar/baz$ pushd() { builtin pushd "$@" >/dev/null; >>> dirs -v

Re: Issus with popd and pushd

2017-04-18 Thread L A Walsh
Chet Ramey wrote: On 4/18/17 9:35 AM, Eduardo Bustamante wrote: Or now that I think about it, you can get away with these functions: # masked builtins dualbus@debian:~/foo/bar/baz$ pushd() { builtin pushd "$@" >/dev/null; dirs -v; }; popd(){ builtin popd "$@" >/dev/null; dirs -v; } T

Re: Issus with popd and pushd

2017-04-18 Thread L A Walsh
L A Walsh wrote: Pete Smith wrote: The problem with: dirs, pushd, popd ... Using an alias solution: popd | sed 's/\s/\n/g' | nl Um... don't you mean to use the alias command somewhere, like: alias popd='builtin popd|tr " " "\n"' Then it seems to work. Is that what you mean by using

Re: Issus with popd and pushd

2017-04-18 Thread L A Walsh
Pete Smith wrote: The problem with: dirs, pushd, popd ... Using an alias solution: popd | sed 's/\s/\n/g' | nl Um... don't you mean to use the alias command somewhere, like: alias popd='builtin popd|tr " " "\n"' Then it seems to work. Is that what you mean by using an alias?

Re: 'history -n' should re-read history file if history is cleared

2017-04-18 Thread Chet Ramey
On 4/17/17 4:58 PM, Siteshwar Vashisht wrote: > Reproducer steps : > >> PROMPT_COMMAND="history -a; history -c; history -n" >> history > > Actual output : > 2 history > > Expected output: > All the older history items from bash history file should be re-read. Why should explicitly cleari

Re: Issus with popd and pushd

2017-04-18 Thread Chet Ramey
On 4/17/17 5:57 PM, Pete Smith wrote: > Ahh that makes sense: > >"That will never change the current directory, since the popd is run in > a subshell." > > So what's the possibility of adding -v option to popd and pushd??? I'd advise doing it with a shell function first; that's much easier t

Re: Issus with popd and pushd

2017-04-18 Thread Chet Ramey
On 4/18/17 9:35 AM, Eduardo Bustamante wrote: > Or now that I think about it, you can get away with these functions: > > # masked builtins > dualbus@debian:~/foo/bar/baz$ pushd() { builtin pushd "$@" >/dev/null; > dirs -v; }; popd(){ builtin popd "$@" >/dev/null; dirs -v; } This would be the pre

Re: Issus with popd and pushd

2017-04-18 Thread Eduardo Bustamante
On Mon, Apr 17, 2017 at 4:57 PM, Pete Smith wrote: [...] > So what's the possibility of adding -v option to popd and pushd??? Feel free to send patches. Under the hood, the pushd/popd builtins call the dirs builtin with no arguments after their execution, so it's just a matter of adding to pushd/