Reputation: 5867
I have a Makefile that is supposed to echo aliases from another file to your local .zshrc
file.
I need to read the contents of the file aliases.sh
, and echo it's contents to ~/.zshrc
, how is this possible?
Upvotes: 19
Views: 31782
Reputation: 9
Depending on permissions, I prefer the following:
$cat aliases.sh | sudo tee ~/.zshrc
If you dont want to overwrite the contents on the destination file use the -a
.
This option tells tee to append to the given file instead of overwriting it.
$ cat aliases.sh | sudo tee -a ~/.zshrc
Upvotes: 0