On Tue, Feb 21, 2012 at 06:49:45PM -0500, Nick Sabalausky wrote:
[...]
> I think that globbing should be done explicity by the app, *but* for
> apps that don't play ball you should be able to *explicitly* do it at
> the command line. Example:
> 
> $someutil *.txt foo.html
> ERROR: Can't find file '*.txt'
> $glob *.txt
> 'hello.txt' 'Modern File Name.txt' 'another.txt'
> $someutil `glob *.txt` foo.html
> Processing hello.txt...done
> Processing Modern File Name.txt...done
> Processing another.txt...done
> Processing foo.html...done

Hmm. I like that idea: have the shell *not* interpolate things by
default, unless you explicitly say to do so. So by default typing:

        rm *.txt

will pass "*.txt" to rm as a single argument, whereas:

        # Not real syntax:
        rm `*.txt`

will expand "*.txt" as a glob and pass the result to rm.


[...]
> Which brings up another little nitpick: When bash displays a prompt,
> it should first check to see if the last char output was a newline. If
> not, it should...ADD ONE!
[...]

Yeah I agree with that one. Unfortunately I don't think it can tell,
because the previous command writes to stdout directly (it doesn't go
through bash -- else it's be too inefficient, you'd have processes
copying stuff from each other all over the place). The terminal doesn't
let you ask "what was the last char sent to you?".

Having said that, though, the terminal *does* have an escape sequences
(yeah, ugh) that bash *could* use to find out where the cursor is, and
if it's not at column 0, insert a newline.

Unfortunately, us old hands have gotten so used to this misbehaviour
that we actually *use* it to detect whether something has a newline at
the end or not. Another of those historical accidents calcified before
it can be disinfected.


T

-- 
BREAKFAST.COM halted...Cereal Port Not Responding. -- YHL

Reply via email to