[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Read?



haahr> 	+ don't strip the trailing newline

If so, the shell programmer needs a facility to strip it off.
(Regexps anyone?  I am crazy enough to suggest adding Henry Spencer's
regexp package with a suitable interface to the shell.  Before anyone
protests, let me point out that this seems a much more fundamental and
useful primitive than other shells' plethora of constructs like
${var%.*}, ${var##*/} etc. etc.)

haahr> 	+ use readline/editline if appropriate

Preferably, yes.

haahr> 	+ let %read take a prompt argument, ala %parse

My first impulse is to say no, what is echo -n for?  But if
readline/editline is used then I presume it needs to do the prompting
to do the job properly(?)

haahr> 	+ don't hardcode the line delimiter as \n

Good idea.  For my own example, if I had a version of find that may be
told to separate lines with a null character, I could then handle find
output with file names containing every conceivable character
including newline.

haahr> 	+ not including any such builtin and dropping the idea entirely

Ah.  Well, since I am the one who asked, don't expect me to be in
favor of this last alternative.  :-)  Though I must admit I can get
away with:   fn read {return ``\n{line}}   for now (thanks for
pointing out the existence of line).

- Harald