All,
I need to replace some words with other words, but sometimes the words are not
present, so I need to add the words.
In a config file I use, it has the following field
KIDS :
Mother : Amanda
Father : Scott
It is easy to swap out the names of mother or father, as the variables are
On Wed, 5 Dec 2007, Nathan Aubrey wrote:
> I need to replace some words with other words, but sometimes the words
> are not present, so I need to add the words.
> In a config file I use, it has the following field
>
> KIDS :
> Mother : Amanda
> Father : Scott
>
>
> It is easy to swap o
What about something like:
$ cat file
KIDS:
Mother : Amanda
Father : Scott
$ cat file | sed 's/:.*/: bob/g'
KIDS: bob
Mother : bob
Father : bob
Not sure what you are trying to do, but the point is that using .* is
probably what you want (it matches even if there is nothing in the fi
On Wednesday 05 December 2007 10:25:30 you wrote:
> What about something like:
>
> $ cat file
> KIDS:
> Mother : Amanda
> Father : Scott
>
> $ cat file | sed 's/:.*/: bob/g'
> KIDS: bob
> Mother : bob
> Father : bob
>
> Not sure what you are trying to do, but the point is that using .*
On Wednesday 05 December 2007 10:31:50 you wrote:
> On Wed, 5 Dec 2007, Nathan Aubrey wrote:
> > I need to replace some words with other words, but sometimes the words
> > are not present, so I need to add the words.
> > In a config file I use, it has the following field
> >
> > KIDS :
> > Moth
Am 05. Dec, 2007 schwätzte Nathan Aubrey so:
moin moin,
I need to replace some words with other words, but sometimes the words are not
present, so I need to add the words.
In a config file I use, it has the following field
KIDS :
Mother : Amanda
Father : Scott
$ ( newkid=anke; oldmom