• 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: Why root?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why root?


  • Subject: Re: Why root?
  • From: Christopher Nebel <email@hidden>
  • Date: Fri, 2 Aug 2002 19:04:15 -0700

At 5:41 pm -0700 2/8/02, Christopher Nebel wrote:

What happens if you say "echo $version" in BBEdit?

John Delacour wrote:

A blank line, same as in the terminal. Do shell script just says ""

Mr Tea wrote:

tcsh 6.10.00 (Astron) 2000-11-19 (powerpc-apple-darwin) options 8b,nls,dl,al,sm,rh,color

Yow -- two conflicting answers! Time to do my own research... ok. Looks like there are a few ways to go about this. BBEdit 6.5 lets you create a "shell worksheet" ("If you are familiar with MPW's Worksheet metaphor, you should be very happy here." Oh, I am!), and you can create it with either your default shell or your choice of shell -- I suppose JD must have used the explicit "/bin/sh" option. I'd expect these to behave like interactive login shells (or at least not be surprised), and indeed they do.

Interestingly, there's another option -- under the #! menu, you can execute a file. If you type in

#!/bin/sh
ls -l

...and Run it, you get a listing of /, not ~, which means BBEdit *isn't* changing the working directory, but is relying on the login behavior of the shell in the Shell Worksheets.

I stand by my previous statement. "do shell script" is a sub-shell, not an interactive login shell, and therefore different rules apply. It is consciously designed to act like sub-shells in other Unix languages, and therefore not changing the working directory to ~ automatically is not a bug.


--Chris Nebel
AppleScript Engineering
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Why root? (From: John Delacour <email@hidden>)

  • Prev by Date: Re: Why root?
  • Next by Date: Re: "+" and "-" are numbers.
  • Previous by thread: Re: Why root?
  • Next by thread: Re: Why root?
  • Index(es):
    • Date
    • Thread