From: superpollo on
Seebs ha scritto:
> On 2010-06-08, superpollo <utente(a)esempio.net> wrote:
>> that's why i asked him for some tutorial. he answered, but told me no
>> cigar: no online or printed advice for clean/standard shell programming.
>
> Of course there is. There's tons of it. The autoconf manual has a great
> deal of information on standard shell programming, and my book talks a
> fair bit about shell programming. ("Beginning Portable Shell Scripting",
> APress)
>
> But you're still missing the point. Nothing anyone said here had to do
> with you needing to know something about standard shell programming you
> don't know now. It was just a suggestion that you write "#!/bin/sh"
> regardless of whether sh is bash or dash or whatever, because it's cleaner
> and less likely to cause trouble on other systems unless you specifically
> *know* that you are depending on non-standard features.

no no i got the point thank you. but then i asked for standard advice,
since the man criticized (rightly) about unclean features in my script.

bye
From: Seebs on
On 2010-06-08, superpollo <utente(a)esempio.net> wrote:
> no no i got the point thank you. but then i asked for standard advice,
> since the man criticized (rightly) about unclean features in my script.

Okay. Well, the most general answers I can give you are the autoconf
manual's section on portable code, and my book. Oh, and Sven Mascheck's
web page has a ton of information about historical shells, but that may
be less important if you're targeting more modern systems.

-s
--
Copyright 2010, all wrongs reversed. Peter Seebach / usenet-nospam(a)seebs.net
http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!
From: superpollo on
Seebs ha scritto:
> On 2010-06-08, superpollo <utente(a)esempio.net> wrote:
>> no no i got the point thank you. but then i asked for standard advice,
>> since the man criticized (rightly) about unclean features in my script.
>
> Okay. Well, the most general answers I can give you are the autoconf
> manual's section on portable code

http://www.gnu.org/software/autoconf/manual/html_node/Portable-Shell.html

this?

bye
From: Seebs on
On 2010-06-08, superpollo <utente(a)esempio.net> wrote:
> Seebs ha scritto:
>> On 2010-06-08, superpollo <utente(a)esempio.net> wrote:
>>> no no i got the point thank you. but then i asked for standard advice,
>>> since the man criticized (rightly) about unclean features in my script.

>> Okay. Well, the most general answers I can give you are the autoconf
>> manual's section on portable code

> http://www.gnu.org/software/autoconf/manual/html_node/Portable-Shell.html

> this?

What do you think? Have you made some kind of effort to compare the thing
you found to the description, to see whether it seems related in any way?
For instance, given that the question had to do with portable or standard
shell scripting, does the page you've linked to appear to discuss ways to
write more portable shell code? Do you see any evidence that might lead
to the theory that this is part of the "autoconf manual"?

Why are you asking this question? Is there some kind of doubt in your mind
that the section described as "Portable Shell Programming" in the autoconf
manual, which starts out with a description of how it offers tips for writing
code which will be portable, would in fact be the "autoconf manual's section
on portable code"?

-s
--
Copyright 2010, all wrongs reversed. Peter Seebach / usenet-nospam(a)seebs.net
http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!
From: WH on
On 06/06/10 02:01, shulamitm wrote:
> Hello,
>
> I'm looking for solution to the following problem:
>
> I have a file contains 2 fileds, but in a few rows, the second field
> go down (without spaces) to the next line.
> How can I join the splitted lines?
>
> For exmple:
>
> I need to change the following :
>
> ERROR1 1
> ERROR2 1
> WARNING1 0
> WARNING2
> 0
> WARNING3
> 0
> ERROR3 1
>
>
> To:
>
>
>
> ERROR1 1
> ERROR2 1
> WARNING1 0
> WARNING2 0
> WARNING3 0
> ERROR3 1
>
> Thanks in advance!

Also the sed version:

sed -e '/\w\W\+\w/!N' -e 's/\n/\t/' file

-WH