[Top][All Lists]

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

Re: shell expansion in strings ?

From: Ben Pfaff
Subject: Re: shell expansion in strings ?
Date: Fri, 10 Feb 2006 19:58:08 -0800
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux)

John Darrington <address@hidden> writes:

> I wonder if it would be a good idea to allow strings to be shell
> expanded.   For example, it would be convenient to be able to write:
> GET FILE='$HOME/foo.sav'.
> instead of 
> GET FILE='/home/john/foo.sav'.

It does sound convenient.

> On the other hand, it makes it slightly incompatible.  Also strings
> which represent data should probably not be expanded, which would mean
> that somehow the syntax parser would have to be able to distinguish
> between the two types of string.

I think that trying to do this in the lexical analyzer is the
wrong place.  Instead, functions that want to open files should
apply this transformation before they open them.  We already have
a function to substitute environment variables, by the way:

One logical place to call fn_interp_vars() would be fn_open(),
which already handles opening many of the files we open in PSPP
(and probably should be doing more of it).
Ben Pfaff 
email: address@hidden

reply via email to

[Prev in Thread] Current Thread [Next in Thread]