Results 1 to 2 of 2
I am trying to update '/etc/profile' to add an entry to $PATH. What I would like to do is insert the new path as the last entry in $PATH, but ...
- 10-17-2008 #1Just Joined!
- Join Date
- Apr 2008
- Posts
- 5
Need to insert text after a specific line of text.
I am trying to update '/etc/profile' to add an entry to $PATH. What I would like to do is insert the new path as the last entry in $PATH, but only for root.
This is the text I want to modify:
What I need is:Code:# Path manipulation if [ `id -u` = 0 ]; then pathmunge /sbin pathmunge /usr/sbin pathmunge /usr/local/sbin fi
I could simply append the following to the end of '/etc/profile', but I was hoping for a more elegant solution.Code:# Path manipulation if [ `id -u` = 0 ]; then pathmunge /sbin pathmunge /usr/sbin pathmunge /usr/local/sbin pathmunge /opt/myapplication/bin after fi
Any help would be appreciated.Code:# Path manipulation if [ `id -u` = 0 ]; then pathmunge /opt/Navisphere/bin after fi
Thanks.
- 10-21-2008 #2Hope the above helps.Code:
# Path manipulation if [ `id -u` = 0 ]; then PATH=$PATH:/opt/myapplication/bin fi


Reply With Quote