replacing variable in sed command
From: kpakya (member46713_at_dbforums.com)
Date: 11/03/03
- Previous message: Andreas Kahari: "Re: HELP - restoring /dev files?"
- Next in thread: Barry Margolin: "Re: replacing variable in sed command"
- Reply: Barry Margolin: "Re: replacing variable in sed command"
- Reply: kpakya: "Re: replacing variable in sed command"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 03 Nov 2003 17:52:59 -0500
Can anyone tell me how do i substitute some shell variable in the search
pattern of a sed command . e.g.
for file in *tc
do
sed -n 's/^.*\($file\).*$//g' temp1 > temp2
done
i know the above wont work, but i have written it show my intention
Here $file should be replaced by shell variable file
thanks and regards
kpakya
-- Posted via http://dbforums.com
- Previous message: Andreas Kahari: "Re: HELP - restoring /dev files?"
- Next in thread: Barry Margolin: "Re: replacing variable in sed command"
- Reply: Barry Margolin: "Re: replacing variable in sed command"
- Reply: kpakya: "Re: replacing variable in sed command"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|