Re: "~" vs. "POSIX file"
Re: "~" vs. "POSIX file"
- Subject: Re: "~" vs. "POSIX file"
- From: "Mark J. Reed" <email@hidden>
- Date: Tue, 24 Oct 2006 17:07:35 -0400
On 10/24/06, Mark J. Reed <email@hidden> wrote:
I don't know of any scripting languages other than the shells and Tcl
that *automatically* do tilde-expansion on filename strings
To (ahem) expand upon this point:
The standard shells do expansion of leading unquoted tildes on all
words as part of standard command-line processing, before the
arguments are passed to any command, no matter what that command may
be:
$ echo ~
/Users/mreed
Tclsh, on the other hand, does not; such expansion is done by the
file(n) command on its own arguments. This can lead to some apparent
inconsistencies:
% file exists ~/foo.txt
1
% cat ~/foo.txt
cat: ~/foo.txt: No such file or directory
child process exited abnormally
As a result, even in Tcl it might be simplest to pretend that
tilde-expansion is not done automatically and request it explicitly as
needed:
% cat [file nativename ~/foo.txt]
hello world
--
Mark J. Reed <email@hidden>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/mailman//archives/applescript-users
This email sent to email@hidden