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; }; popd(){ builtin popd "$@" >/dev/null; dirs -v; } >>> >> >> This would be the preferable alternative, since it's so trivial. The one >> change I would suggest would be to make the `;' a `&&': >> >> pushd() >> { >> builtin pushd "$@" >/dev/null && dirs -v >> } >> >> > Maybe add 'builtin' before "dirs" since we're redefining builtins > (i.e. get into habit?)
Sure, if there's a chance there's a function named `dirs' and you *don't* want to use it, this is good practice. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, UTech, CWRU c...@case.edu http://cnswww.cns.cwru.edu/~chet/