Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

replace $ character

Status
Not open for further replies.

vti

Technical User
Feb 26, 2001
189
TR

hi i would like replace $ character in a file with sed but how.When i try by sed command i can't because of $ character.

for example :

i want to replace $HOME_PATH with /usr/users/user in a file.

thanks
 
The $ should be ok since it is not at the end of the search string. However, the /'s would be a problem if you used a / as the delimeter. This should work:
Code:
sed "s#$HOME_PATH#/usr/users/user#" infile
Hope this helps. CaKiwi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top