Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!ccu.umanitoba.ca!herald.usask.ca!alberta!arcsun.arc.ab.ca!arcsun!kenw From: kenw@skyler.arc.ab.ca (Ken Wallewein) Newsgroups: comp.os.misc Subject: Re: Globbing Message-ID: Date: 26 Mar 91 01:38:03 GMT References: Sender: nobody@arc.ab.ca (Absolutely Nobody) Organization: Alberta Research Council, Calgary Alberta, Canada Lines: 75 In-Reply-To: peter@ficc.ferranti.com's message of 22 Mar 91 16:29:12 GMT In article peter@ficc.ferranti.com (Peter da Silva) writes: As an excersize I am in the process of writing a shell for UNIX that only performs globbing when requested. It is not going to be anything of the complexity of the regular UNIX shells... sort of a baby shell for novices. So far the total length of the shell is 472 lines, and it already parses statements and executes them. No globbing is as yet implemented. + echo 'The only quoting character is single quotes' The only quoting character is single quotes Ok. + echo 'Unclosed quotes are automatically and silently closed Unclosed quotes are automatically and silently closed Good. + echo 'You continue a line\ - by escaping it with a backslash' You continue a line by escaping it with a backslash Good -- except how to continue without including newline? Here's a suggestion: allow escaping _anything_. It bugs me that csh doesn't respect escaping quotes or spaces. + echo 'You quote a quote by doubling it''' You quote a quote by doubling it' Good. And... + echo 'I''m planning on doing globbing like so: [*.c]' I'm planning on doing globbing like so: split.c getline.c bsh.c domagic.c I don't think I like the use of [] though. No major reasons, just little things like it uses two characters instead of one, and isn't space-terminated. I'd prefer a sort of reverse-escape approach that worked on a space-delimited string instead of a character, e.g. +*.o*, where "+" is the reverse escape. Any suggestions? I was thinking of continuing lines if there were unclosed quotes, but that has proven a source of confusion on UNIX with the bourne shell. Agreed. I'd like to see some thought given to how you would handle the result of globbing on a directory with file names containing "*", leading "-", spaces, etc... Explicit globbing would take care of "*"; maybe the globber should escape "-", spaces, etc., automatically? What would happen if this were passed through multiple handlers? Ambiguity can be powerful, but sometimes it is dangerous. Somethimes we need to be able to say "THAT is PRECISELY what I mean". It seems to be rather difficult in most shells that support globbing. And, of course, any interest? Yes! I'd like a copy when/if it's available. -- Peter da Silva. `-_-' peter@ferranti.com +1 713 274 5180. 'U` "Have you hugged your wolf today?" -- /kenw Ken Wallewein A L B E R T A kenw@noah.arc.ab.ca <-- replies (if mailed) here, please R E S E A R C H (403)297-2660 C O U N C I L