Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Shell script to set environment variables permanently

I need to write a shell script to set environment variable and modify path variable permanently. Is there in any way to modify bashrc file through script?

like image 475
user1516872 Avatar asked May 03 '26 00:05

user1516872


1 Answers

Yes, you write a script that appends to .bashrc with the >> redirection operator:

echo Your Text >> ~/.bashrc

See also I/O Redirection

like image 95
Wernsey Avatar answered May 04 '26 13:05

Wernsey



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!