Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Best practices for managing aliases in ohmyzsh?
On 2021-08-31 10:57 a.m., Roman Perepelitsa wrote:
function md () {
(( ARGC == 1 )) && mkdir -p -- "$1" && cd -- "$1"
}
Upon executing `md /tmp/foo` I expect my current directory to be
/tmp/foo. This cannot work if md is a script.
contents of script 'test':
(( ARGC == 1 )) && mkdir -p -- "$1" && cd -- "$1"
... giving it a run:
4 /aWorking/Zsh/Source/Wk/Junk 0 $ . test /tmp/foo
4 /tmp/foo 0 $
... seems to work fine, I must be misunderstanding you.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author