The syntax of sed command is stated as
sed options 'address action' file(s)
I wanted to know how to use shell variables in address and action i.e i have the line number and string which has to be substituted in a shell variable. I tried using shell variables by double quoting them ..but it does not work. Let me know if this is possble ..... And if not ... could you suggest me with an alternative
Abbasali
__________________________________ Do you Yahoo!? New Yahoo! Photos - easier uploading and sharing. http://photos.yahoo.com/
The simplest method to use variables in a sed command is to enclose your sed command in double quotes ( ") instead of single quotes ( '). Because the shell performs variable substitution on double-quoted strings, the shell will substitute the value of any variables you specify before sed executes.
For example, the command
sed "/$DEL/d" file1 > file2
deletes all the lines in file1 that contain the value stored in the variable $DEL.
--------------------------------- Do you Yahoo!? New Yahoo! Photos - easier uploading and sharing