Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Best practices for managing aliases in ohmyzsh?



On 2021-08-31 8:01 p.m., Bart Schaefer wrote:

The answer is to make them
executable and put bash in the #! line, so that bash continues to be
what runs them.
Ok, that's all transparent.  What puzzles me is why the now executable file won't run Roman's example.  Just tried it, and indeed it doesn't work.  Lots of test lines work but not the 'mkdir' and not the 'cd'.  'cd' being a builtin I'm wondering why it doesn't work in an executed file:

    #!/usr/bin/zsh
    echo "This echos just fine"
    cd -- "/tmp"

... no 'cd'.  So far I've not come across any reason to do anything other than source my scripts but if I ever do I'd like to understand this.






Messages sorted by: Reverse Date, Date, Thread, Author