Message-ID: <3A3F5E1C.1E31C9E0@turk.net> Date: Tue, 19 Dec 2000 15:09:48 +0200 From: Togan Muftuoglu <toganm@turk.net> Subject: Another script question OK I promise I will learn howto do basic scripting as soon as possible. On the other hand I do have another question this is want I want to do word1 word2 word3 .... will be written to the file like as word1 word2 word3 ... <p><p>TIA -- Togan Muftuoglu toganm@turk.net 100% MS FREE Absolutely no component of Microsoft was used in the generation or posting of this e-mail. So it is virus free
Message-ID: <3A3F6421.B609F73F@asml.nl> Date: Tue, 19 Dec 2000 14:35:29 +0100 From: Martijn van den Burg <Martijn.van.den.Burg@asml.nl> Subject: Re: [SLE] Another script question Hi Togan, Togan Muftuoglu wrote:
OK I promise I will learn howto do basic scripting as soon as possible. On the other hand I do have another question this is want I want to do
word1 word2 word3 .... will be written to the file like as
word1 word2 word3 ...
Here you go: perl -e 'while (<>) { chomp; print "$_ "; }' -i~ * <p>Bye, Martijn -- = Martijn van den Burg = Think globally = = Publications Department, ASML = Act locally = = Voice: +31 (0)40 268 3856 = = = Fax: +31 (0)40 268 2960 = =
Message-ID: <3A3F6781.944D9B73@hursley.ibm.com> Date: Tue, 19 Dec 2000 13:49:53 +0000 From: Derek Fountain <fountai@hursley.ibm.com> Subject: Re: [SLE] Another script question
OK I promise I will learn howto do basic scripting as soon as possible. On the other hand I do have another question this is want I want to do
word1 word2 word3 .... will be written to the file like as
word1 word2 word3 ...
Here you go:
perl -e 'while (<>) { chomp; print "$_ "; }' -i~ *
Why the loop? -n will do that for you: perl -ni~ -e 'chomp; print "$_ ";' *
Message-ID: <3A3F6E21.1FDFEBD3@asml.nl> Date: Tue, 19 Dec 2000 15:18:09 +0100 From: Martijn van den Burg <Martijn.van.den.Burg@asml.nl> Subject: Re: [SLE] Another script question Hi, Derek Fountain wrote:
OK I promise I will learn howto do basic scripting as soon as possible. On the other hand I do have another question this is want I want to do
word1 word2 word3 .... will be written to the file like as
word1 word2 word3 ...
Here you go:
perl -e 'while (<>) { chomp; print "$_ "; }' -i~ *
Why the loop? -n will do that for you:
perl -ni~ -e 'chomp; print "$_ ";' *
It's just /a/ way, that's what I like as much about Perl as about Linux: there's choice! And some are more fluent in one-liners than others, got to give you that :) The scripts I write are either CGI scripts or programs requiring considerable user input in a terminal, in both cases they're too long for a one-liner. Bye, Martijn -- = Martijn van den Burg = Think globally = = Publications Department, ASML = Act locally = = Voice: +31 (0)40 268 3856 = = = Fax: +31 (0)40 268 2960 = =
Date: Tue, 19 Dec 2000 15:07:21 +0100 (CET) From: Mertz Denis <mertz@L2MP.u-3mrs.fr> Message-ID: <Pine.LNX.4.31.0012191504070.589-100000@matop.u-3mrs.fr> Subject: Re: [SLE] Another script question On Tue, 19 Dec 2000, Togan Muftuoglu wrote:
word1 word2 word3 .... will be written to the file like as
word1 word2 word3 ...
Here is the awk version for doing that : awk 'NF>=1 {print $0}' ORS=' ' file.in > file.out <p><p> -- Mertz Denis
From: Álvaro A. Novo <novo@uiuc.edu> Date: Tue, 19 Dec 2000 10:39:24 -0600 Message-Id: <0012191039240M.00483@friedman> Subject: Re: [SLE] Another script question On Tuesday 19 December 2000 07:09, Togan Muftuoglu wrote:
OK I promise I will learn howto do basic scripting as soon as possible. On the other hand I do have another question this is want I want to do
word1 word2 word3 .... will be written to the file like as
word1 word2 word3 ...
For the sake of completeness in vi: :map t Jt then place the cursor on the first line and press t Alvaro Novo SuSE 6.4 -=- Kernel 2.2.17 -=- KDE 2.0.1 10:39am up 1 day, 19:46, 5 users, load average: 0.84, 0.33, 0.11
participants (5)
-
fountai@hursley.ibm.com
-
Martijn.van.den.Burg@asml.nl
-
mertz@L2MP.u-3mrs.fr
-
novo@uiuc.edu
-
toganm@turk.net