• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: "~" vs. "POSIX file"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Follow-Ups:
    • Re: "~" vs. "POSIX file"
      • From: Philip Aker <email@hidden>
References: 
 >How can I open attachment in Mail ? (From: Victor Frenklakh <email@hidden>)
 >Re: How can I open attachment in Mail ? (From: kai <email@hidden>)
 >Re: How can I open attachment in Mail ? (From: Philip Aker <email@hidden>)
 >Re: How can I open attachment in Mail ? (From: kai <email@hidden>)
 >Re: How can I open attachment in Mail ? (From: Philip Aker <email@hidden>)
 >"~" vs. "POSIX file" (From: Christopher Nebel <email@hidden>)
 >Re: "~" vs. "POSIX file" (From: "Mark J. Reed" <email@hidden>)

  • Prev by Date: Re: Applescript to trap when I insert my ipod?
  • Next by Date: Re: Get filestructure in a variable
  • Previous by thread: Re: "~" vs. "POSIX file"
  • Next by thread: Re: "~" vs. "POSIX file"
  • Index(es):
    • Date
    • Thread