FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 04-17-2012, 01:52 PM
Eduardo M KALINOWSKI
 
Default Scripting question

On Ter, 17 Abr 2012, Chris wrote:

Firstly I petty much suck at scripting so I need help.

I have a file where each line begins with

Smtp:

I would like have the Smtp: replaced with To: leaving all that
follows in each line untouched and piped into a new file.


man sed


--
The majority of husbands remind me of an orangutang trying to play the violin.
-- Honor'e DeBalzac

Eduardo M KALINOWSKI
eduardo@kalinowski.com.br




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

Archive: 20120417105220.Horde.5niudUisJlFPjXWUaIYVfNA@mail. kalinowski.com.br">http://lists.debian.org/20120417105220.Horde.5niudUisJlFPjXWUaIYVfNA@mail. kalinowski.com.br
 
Old 04-17-2012, 02:11 PM
Daniel Landau
 
Default Scripting question

On Tue, Apr 17, 2012 at 4:52 PM, Eduardo M KALINOWSKI
<eduardo@kalinowski.com.br> wrote:
> On Ter, 17 Abr 2012, Chris wrote:
>> I would like have the Smtp: replaced with To: *leaving all that follows in
>> each line untouched and piped into a new file.
>
> man sed
>

Read that too, but try also searching online for "sed tutorial". The
line to do this specific thing is:

$ sed -e 's/^Smtp:/To:/' oldfile > newfile

Daniel Landau


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: CAPBTYu4KBgb55tjHHXysWed=+s2=kDnSECYNT1i=H1JoWm9XT Q@mail.gmail.com">http://lists.debian.org/CAPBTYu4KBgb55tjHHXysWed=+s2=kDnSECYNT1i=H1JoWm9XT Q@mail.gmail.com
 
Old 04-17-2012, 02:48 PM
emmanuel segura
 
Default Scripting question

perl -e 'while(<>){chomp; s/root/Root/g; print* "$_
"; }' /etc/passwd



Il giorno 17 aprile 2012 15:52, Eduardo M KALINOWSKI <eduardo@kalinowski.com.br> ha scritto:

On Ter, 17 Abr 2012, Chris wrote:


Firstly I petty much suck at scripting so I need help.



I have a file where each line begins with



Smtp:



I would like have the Smtp: replaced with To: *leaving all that follows in each line untouched and piped into a new file.




man sed





--

The majority of husbands remind me of an orangutang trying to play the violin.

* * * * * * * *-- Honor' e DeBalzac



Eduardo M KALINOWSKI

eduardo@kalinowski.com.br









--

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


Archive: http://lists.debian.org/20120417105220.Horde.5niudUisJlFPjXWUaIYVfNA@mail. kalinowski.com.br






--
esta es mi vida e me la vivo hasta que dios quiera
 

Thread Tools




All times are GMT. The time now is 03:13 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org