I know you can change a line in a text file using sed in bash that shows something like;
name=”applicationname” //this is not the issue (it varies, thats why i use a var)
Depiction: http://google.com
or
Depiction: http://yahoo.com //some times the ‘value’ in depiction varies
to
Depiction: http://mysite.com/depiction.php?package=applicationname //this is the format i would like to achieve
by using sed, but I’m not entirely sure how to implement sed.
http://www.gnu.org/software/sed/
EDIT: This is what i just came up with
sed -i "s!Depiction:.*!Depiction: http://mysite.com/depiction.php?package=$name!" ./inputfile
What if in this particular text file, there isnt a ‘Depiction:’?
how do i insert a line: Depiction: http://mysite.com/depiction.php?package=applicationname ?
I’ve managed to come up with the answer with many trials and errors… so just to share. 🙂