This question already has answers here:
How to cat <<EOF >> a file containing code?
(3个答案)
What is more portable? echo -e or using printf?
(2个答案)
12个月前关闭。
目前,我有一个脚本可以在.bashrc中添加行。这里有几行。我觉得这不是最优雅的方式。有更好的办法吗?
echo 'echo -e "\033[1mhtop\033[0m \033[3m(Display dynamic real-time information about running processes)\033[0m"' >> ~/.bashrc && \
echo 'echo -e "\033[1mneofetch\033[0m \033[3m(CLI tool to display information about your operating system, software and hardware)\033[0m"' >> ~/.bashrc && \
echo 'echo -e "\033[1mnethogs =\033[0m eg; sudo nethogs \033[4meno1\033[0m \033[3m(Monitor bandwidth usage per process)\033[0m"' >> ~/.bashrc

最佳答案

cat <<EOF >>~/.bashrc
blabla
blabla
blablablalba
EOF

关于linux - 将字符串管道传送到bashrc的更好方法,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/53275383/

10-12 04:02
查看更多