Opened 15 years ago

Closed 15 years ago

#2462 closed task (fixed)

Consistency issues in a few commands

Reported by: chris@… Owned by: bdubbs@…
Priority: normal Milestone: 6.5
Component: Book Version: SVN
Severity: normal Keywords:
Cc:

Description

There are a few commands that need "-v" switches added to them. Also, there are some sed commands in Chapter 6 that have an unnecessary "-e" even though there is only one expression there...and then one sed command that has an "i.bak" (Chapter 6 Binutils) when none of the other seds create a backup...is there a particular reason for it?

Attachments (1)

command-updates.patch (4.3 KB ) - added by chris@… 15 years ago.
Fix -v and -e switches

Download all attachments as: .zip

Change History (8)

by chris@…, 15 years ago

Attachment: command-updates.patch added

Fix -v and -e switches

comment:1 by bdubbs@…, 15 years ago

I disagree about the -e switches. The may not be strictly necessary, but it communicates to the user exactly what is intended. I'd prefer to leave them in.

in reply to:  1 comment:2 by chris@…, 15 years ago

Replying to bdubbs@…:

I disagree about the -e switches. The may not be strictly necessary, but it communicates to the user exactly what is intended. I'd prefer to leave them in.

Not really sure what you mean, as I don't quite see how "-e" means anything to anyone except those who are already familiar with sed, and it isn't elaborated on anywhere in the book.

But then I don't feel very strongly about it anyway. I would prefer that all the commands that don't need the additional unneeded options dropped them, but if it's believed that keeping them there somehow makes it clearer, that's fine too. My real goal is just keeping it consistent.

Of course that also means if the "-e"s are kept, I think they should also be *added* to any sed commands that don't currently have them.

comment:3 by bdubbs@…, 15 years ago

The sed man page says:

sed [OPTION]... {script-only-if-no-other-script} [input-file]...

Using the {script-only-if-no-other-script} construct is position dependent.

In the past we've used different constructs to do similar things to enhance the learning aspect of the book. This is somewhat similar to the position of using head -3 filename vs head -n3 filename. In my mind, more explicit is generally better.

A quick check with a few greps show 12 instances with using sed with -e and 26 without. I'm in favor of leaving the style of these instructions as they are.

Occasional use of the -i.orig construct is OK with me too.

comment:4 by Matthew Burgess, 15 years ago

Milestone: 6.5

comment:5 by bdubbs@…, 15 years ago

Owner: changed from lfs-book@… to bdubbs@…
Status: newassigned

comment:6 by bdubbs@…, 15 years ago

Fixed the -v issues but left the sed -e changes the way they are.

Leaving open for now. Matt go ahead and close if you are satisfied with revision 9018.

comment:7 by Matthew Burgess, 15 years ago

Resolution: fixed
Status: assignedclosed

Thanks Bruce. Happy to close without the sed -e changes. If more folks begin to mention it, we can reassess.

Note: See TracTickets for help on using tickets.