13

how to use SED to replace a line

view full story
linux-howto

http://www.unix.com – Hi I am a complete novice with sed and want to use sed to replace this line in the input file /data/folder/date/etc/etc/etc/etc/etc/name with /data/folder/date/etc/etc/etc/etc/etc/$name where I input the variable $name trouble is is there anyway I don't have to write out the whole line to be replaced (due to the length and that the name various every time so I don't want to have to edit the script everytime, which is the point of writing a script!). So how do I specify the SED command so that it recognises the line beginning with /data/folder/etc and replace only the last variable? Ma (HowTos)