🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.os.hp-ux
Article #4012

Re: Problem ze skryptem

#4012
From: Szejku
Date: Fri, 20 Feb 2004 17:32
55 lines
2293 bytes
Użytkownik "Piotr KUCHARSKI" <chopin@sgh.waw.pl> napisał w wiadomości
news:c15e81$nkp$1@absolut.sgh.waw.pl...
> Szejku <niepytajkto@poczta.onet.pl> wrote:
> > a dlaczego, jezeli w mojej wersji nie dawalem znaku "\n", to wyrzucal
> > wszystko "szeregowo" ?
>
> man read
>
> DESCRIPTION
>      The read utility will  read  a  single  line  from  standard
>      input.
>      [...]
>      The line will be split into fields  as  in  the  shell;  the
>      first  field will be assigned to the first variable var, the
>      second field to the second variable var, and so  forth.
>
> Czego nie rozumiesz w manualu?
>
> p.
np. tego, ze gdy zrobilem
cat plik1.txt | while read x y z w
    do
        printf("%s\t%s\t%s\t%s") $x $y $z $w
    done
to dostawalem:
123    43     23    234234    45    643    345 .....
a jak zrobilem:
cat plik1.txt | while read x y z w
    do
        printf("%s\t%s\t%s\t%s\n") $x $y $z $w
    done
to dostalem:
123
43
23
234

234
45
643
345

551
365
94
199
a myslalem, ze dostane:
123    43    23    234
234    45    643    345
551    365    94    199
Nie rozumiem, dlaczego wstawienie "\n" tak drastycznie zmienilo postac
wyjsciowa danych.
Pozdrawiam,
Maciek
Technical Details
Message-ID: <c15gd6$kha$1@atlantis.news.tpi.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.rmf.pl!agh.edu.pl!news.agh.edu.pl!news2.icm.edu.pl!newsfeed.tpinternet.pl!atlantis.news.tpi.pl!news.tpi.pl!not-for-mail
References: <65ac.000001bb.403603c2@newsgate.onet.pl> <c152sq$v46$1@srv.cyf-kr.edu.pl> <c15ddg$16g$1@nemesis.news.tpi.pl> <c15e81$nkp$1@absolut.sgh.waw.pl>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.rmf.pl!agh.edu.pl!news.agh.edu.pl!news2.icm.edu.pl!newsfeed.tpinternet.pl!atlantis.news.tpi.pl!news.tpi.pl!not-for-mail
From: "Szejku" <niepytajkto@poczta.onet.pl>
Newsgroups: pl.comp.os.hp-ux
Subject: Re: Problem ze skryptem
Date: Fri, 20 Feb 2004 18:32:54 +0100
Organization: tp.internet - http://www.tpi.pl/
Lines: 58
Message-ID: <c15gd6$kha$1@atlantis.news.tpi.pl>
References: <65ac.000001bb.403603c2@newsgate.onet.pl> <c152sq$v46$1@srv.cyf-kr.edu.pl> <c15ddg$16g$1@nemesis.news.tpi.pl> <c15e81$nkp$1@absolut.sgh.waw.pl>
NNTP-Posting-Host: vp191.neoplus.adsl.tpnet.pl
X-Trace: atlantis.news.tpi.pl 1077298407 21034 80.50.135.191 (20 Feb 2004 17:33:27 GMT)
X-Complaints-To: usenet@tpi.pl
NNTP-Posting-Date: Fri, 20 Feb 2004 17:33:27 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2720.3000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2727.1300
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit