Re: Re: sed "Hello, world!" program?

"Thierry Blanc" <[email protected]>
Newsgroups gmane.editors.sed.user
Message-ID <trinity-dda25fdd-3194-4b46-ac6b-92a98026f8ac-1393249654285@msvc024>
Agree.

If echo I would rather go for

sed ...<<<"hello world"

--

Sent from my FAIR phone with GMX Mail. Please excuse my brevity.

Tim Chase <[email protected]> wrote:

On 2014-02-23 17:52, [email protected] wrote:

> So here is an alternate suggestion for the sed "Hello, world!"

> example for group members to consider:

>

> ------------------------------

> # convert input text stream to "Hello, world!"

> s/.*/Hello, world!/

> q

> ------------------------------

>

> sed is really two things in one: 1) the command-line utility. 2)

> the simple scripting language that the sed utility reads. By

> separating out the script from the command line environment, this

> example is immune (I think) to command line oddities like the C

> shell behavior and differences in sed versions.

>

> So is this the best "Hello, world!" example? Or is there some other

> defect lurking, or some better way?

I think this is my favorite so far. It should be cross-platform with

the following benefits:

- no trouble escaping the "!"

- no trouble with single-vs-double quotes

- no need for a specific external utility (though "echo" still has

fairly broad support) as long as you have *something* that produces

output on stdout, including any arbitrary text file

- no dependency on redirecting-stderr notation

- demonstrates that sed scripts can be external files, not just the

command command-line usage

- demonstrates use of the archetypal s/// command

So I'm +1 on this.

-tkc

------------------------------------

--

Yahoo Groups Links

<*> To visit your group on the web, go to:

http://groups.yahoo.com/group/sed-users/

<*> Your email settings:

Individual Email | Traditional

<*> To change settings online go to:

http://groups.yahoo.com/group/sed-users/join

(Yahoo! ID required)

<*> To change settings via email:

[email protected]

[email protected]

<*> To unsubscribe from this group, send an email to:

[email protected]

<*> Your use of Yahoo Groups is subject to:

http://info.yahoo.com/legal/us/yahoo/utos/terms/

__._,_.___

Reply via web post

Reply to sender

Reply to group

Start a New Topic

Messages in this topic
(17)

--

Visit Your Group

-
New Members
1

http://groups.yahoo.com/;_ylc=X3oDMTJkMXBjMW9hBF9TAzk3NDc2NTkwBGdycElkAzI0ODk2MzkEZ3Jwc3BJZAMxNzA5MzM1MDAyBHNlYwNmdHIEc2xrA2dmcARzdGltZQMxMzkzMjQ5NjY2

• Privacy • Unsubscribe • Terms of Use

.

__,_._,___
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.