Re: script Frage

From: Manfred Lotz <manfred.lotz(at)arcor.de>
Date: Sun, 19 Apr 2009 09:38:02 +0200

Oliver Fromme wrote:
> Polytropon <freebsd(at)edvax.de> wrote:
> > Manfred Lotz wrote:
> > > Ich kann in einem Script schreiben:
> > >
> > > cmd1 &&
> > > cmd2 &&
> > > cmd3
> > >
> > > ohne \ als continuation character zu benutzen.
> > >
> > > Es funktioniert. Frage: Sollte ich sowas dennoch vermeiden und lieber \
> > > benutzen?
>
> Das ist POSIX-Standard. Du kannst es bedenkenlos verwenden.
> Folgendes ist aus der Shell-Grammatik von POSIX 1003.1-2001
> bzw. SUSv3:
>
> and_or : pipeline
> | and_or AND_IF linebreak pipeline
> | and_or OR_IF linebreak pipeline
>
> Wobei <linebreak> eine Folge von beliebig vielen (auch
> null) Newlines ist.
>
> Das gleiche funktioniert übrigens auch bei Pipelines.
> Ich schreibe öfters Pipelines mit Newlines ohne '\':
>
> grep foo irgendwo |
> cut ... |
> sed ... |
> awk ...
>
>
Ich muss mir angewöhnen in so einem Falle, wenn ich in den shell man
pages nichts finde (vielleicht isses ja dennoch dokumentiert), den POSIX
Standard anzugucken.

-- 
Danke,
Manfred
To Unsubscribe: send mail to majordomo(at)de.FreeBSD.org
with "unsubscribe de-bsd-questions" in the body of the message
Received on Sun 19 Apr 2009 - 09:38:13 CEST

search this site