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

Re: echo "true" > ~/.zshrc from ~/.zshrc



On 11 June 2016 at 18:34, Nikolay Aleksandrovich Pavlov (ZyX)
<kp-pav@xxxxxxxxx> wrote:
> What do you mean by “legal”?

This seems like absurd thing to do, I was searching for some
reasonable constraints in this, thus the word "legal".

> If you do something like this you need to understand what is going on: see `man zshmisc`, section “REDIRECTION”. Specifically `>>` appends to zshrc, `>` *empties* zshrc and then appends: nearly equivalent is `rm ~/.zshrc; echo true > ~/.zshrc`.

Thanks

> I personally would not suggest to *ever* edit zshrc using `echo … >[>] ~/.zshrc`: this is a script and using `echo >>` to edit it will over time turn zshrc into an unorganized junkyard. If you need to do some edits, take text editor and edit ~/.zshrc, keeping it organized. This is especially needed if you have many aliases which may alter the subsequent code.

Thanks for the point about aliases

-- 
Best regards,
Sebastian Gniazdowski



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