• 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: Shell script
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Shell script


  • Subject: Re: Shell script
  • From: Christopher Nebel <email@hidden>
  • Date: Tue, 19 Apr 2005 16:50:50 -0700

On Apr 19, 2005, at 4:22 PM, Martin Orpen wrote:

on 19/4/05 23:59, Christopher Nebel at email@hidden wrote:

Multiple slashes are not relevant in POSIX paths -- you can think of the path separator as "one or more slashes". This is in contrast to HFS paths, where multiple colons are highly relevant.

They should be irrelevant, but they aren't - as was recently discussed on MACSCRPT where multiple slashes will inadvertently launch apps which aren't seen by the Finder and need sudo kill to get rid of:


sudo -b "/Applications/TextEdit.app/Contents/MacOS/TextEdit"

sudo -b "/Applications/TextEdit.app//Contents/MacOS/TextEdit"

They look the same to me.

I get a difference on my powerbook.

The first line opens TextEdit as root but it can be quit conventionally in the Finder.

The second line opens also opens TextEdit as root but, although you can see the editing window, the application process is hidden and can't be quit from the Finder - you have to use sudo kill.

Allow me to rephrase: multiple slashes are irrelevant to BSD calls that accept path strings, such as fopen(3) or execve(2). Clients that try to do things themselves can potentially mess up -- for instance, if someone naively tried to figure out the path components of the second path without canonifying first, they'd get an extra zero-length component in the middle. Trouble would doubtless ensue.


As to the specific problem mentioned above, it sounds like a bug to me. I'm not sure how to quit anything from the Finder, but I'd venture that this problem is fixed in Tiger, as both lines produce TextEdits that can be quit in the usual ways.


--Chris Nebel AppleScript Engineering

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Scripting Mail error
      • From: Hudson Barton <email@hidden>
References: 
 >Re: Shell script (From: Martin Orpen <email@hidden>)

  • Prev by Date: Re: Shell script
  • Next by Date: [ANN] FastScripts 2.2
  • Previous by thread: Re: Shell script
  • Next by thread: Scripting Mail error
  • Index(es):
    • Date
    • Thread