Access to raw command line?

Donn Cave donn at u.washington.edu
Fri Apr 27 14:48:58 EDT 2007


In article <1331lv4rshck2e at corp.supernews.com>,
 Grant Edwards <grante at visi.com> wrote:

> On 2007-04-26, Donn Cave <donn at u.washington.edu> wrote:
> 
> >> One possible way to work around this is to get the raw command line
> >> and do the shell expansions ourselves from within Python. Ignoring the
> >> question of whether it is worth the trouble, does anybody know if it
> >> is possible to obtain the raw (unexpanded) command line?
> >
> > If you're on VMS (well, you didn't say), you're in luck.
> >
> > The UNIX shell has already expanded the file globbing by the
> > time your program starts up, but VMS leaves it to the application,
> > with the help of a handy RMS$ function or two so it gets done in
> > a consistent way.  This allows the command line interface to
> > interact with the user in a little more transparent way, since
> > the input seen by the program is congruent with what the user
> > typed in.  E.g., "rename *.jpeg *.jpg" is trivial on VMS,
> > impossible on UNIX.
> 
> Typing  rename '*.jpeg' '*.jpg' is impossible?

It is not (of course, nor is implementation impossible), but as
noted earlier in this thread it isn't idiomatic.  You can present
an interface like this to a user who has been specially trained
to use it, but no one would naturally expect it to work, without
prior instruction, so it isn't any more or less interesting than,
say, "rename *.jpeg .jpeg".   (Oops, now that I think of it, that's
what I should have said works on VMS anyway.  Been too long.)

   Donn Cave, donn at u.washington.edu



More information about the Python-list mailing list