Re: keeping the two latest files on a folder



On 10/18/09, Javier Barroso <javibarroso@xxxxxxxxx> wrote:
Hi,

On Sun, Oct 18, 2009 at 5:32 AM, Israel Garcia <igalvarez@xxxxxxxxx> wrote:
Hi Guys, that's me again.. I'm stuck again with sed to make a change
to a file.. sorry if it sounds off-topic.. but I need your help :-).

I've just want to change on a file this line:

vif = [ 'ip=167,112,134.223,mac=00:16:3E:FD:58:B8']

to:

vif =
['ip=167,112,134.223,mac=00:16:3E:FD:58:B8,vifname=veth216','ip=10.1.1.1,mac=00:16:3E:FD:58:BB,vifname=veth216a']

AND, if it's possible to change tha last two entries of mac address,
B8 to C8 for example..

sed -i
'/^vif/s/B8.*$/C8,vifname=veth216'"'"','"'"'ip=10.1.1.1,mac=00:16:3E:FD:58:BB,vifname=veth216a'"'"']'
file.cfg
Hi Javier,

It doesn't work for me:

server:/tmp# cat a
vif = [ 'ip=167,112,134.223,mac=00:16:3E:FD:58:B8']

server:/tmp# sed -i
'/^vif/s/B8.*$/C8,vifname=veth216'"'"','"'"'ip=10.1.1.1,mac=00:16:3E:FD:58:BB,vifname=veth216a'"'"']'
a
sed: -e expression #1, char 87: unterminated `s' command


regards,
Israel.

As it is dificult to read see this explication:
If you want to use a ' inside replace string such is the case you must:
type ' to close string
Then type " to open a new concatenated string
type ' to write '
type " to close the concatenated string
type ' to concatenate the next string (following with the replace string)

Regards,



--
Regards;
Israel Garcia


--
To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx
with a subject of "unsubscribe". Trouble? Contact listmaster@xxxxxxxxxxxxxxxx



Relevant Pages

  • Trouble with concatenated string function
    ... the Many table of a 1:M relationship into a concatenated string. ... I'd like to change the function so the last record in the string is ... I've tried to edit the function to use the ampersand. ... Dim rs As Recordset ...
    (comp.databases.ms-access)
  • Re: Trouble with concatenate function
    ... Within the loop, you'll need to keep track of what the current record is so ... you should have a concatenated string now ... > Function fConcatChild(strChildTable As String, ... > Dim rs As Recordset ...
    (microsoft.public.access.queries)
  • Re: DTS - Global Rowset - Use in Execute SQL Task
    ... You then insert this whole concatenated string ... Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP) www.SQLDTS.com - The site for all your DTS needs. ... But after assigning the> Satement I need to execute the DataPump Task somehow:> ...
    (microsoft.public.sqlserver.dts)
  • Re: Dynamic ToolTip?
    ... I see how this will build me a concatenated string of names, ... how it would "connect" to the current value of txtWhatever (bearing in mind ... Dim rst As DAO.Recordset ...
    (microsoft.public.access.formscoding)
  • Re: keeping the two latest files on a folder
    ... If you want to use a ' inside replace string such is the case you must: ... Then type " to open a new concatenated string ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ... Trouble? ...
    (Debian-User)