Re: osascript and text output
Re: osascript and text output
- Subject: Re: osascript and text output
- From: "Mark J. Reed" <email@hidden>
- Date: Mon, 28 Jul 2008 16:55:20 -0400
Copy to the list bounced, resending.
Also: for a simple demonstration of the difference, try this:
$ (echo >"$(tty)" Hello) </dev/null
Which generates no visible output. (And without the quotes will
actually generate an error from bash about an "ambiguous redirect",
because tty returns no output). While this works:
$ (echo >/dev/tty Hello) </dev/null
On Mon, Jul 28, 2008 at 4:45 PM, Mark J. Reed <email@hidden> wrote:
> On Mon, Jul 28, 2008 at 4:34 PM, Skeeve <email@hidden> wrote:
>> Hmmm… But is /dev/tty the same as the output of /usr/bin/tty?
>
> /dev/tty is a pseudo-device; opening it gets you the a file descriptor
> open on the terminal attached to the process.
>
> The output of the /usr/bin/tty command is the name of the tty attached
> to the current process's standard input, which you can then open to
> get a similar result.
>
> Theoretically, it's possible for tty to return the name of a different
> tty than the one you want output to go to. Somewhat more
> realistically, especially when you have commands running under
> different uid's via sudo, it's possible to run a command that doesn't
> actually have permission to open the terminal device by name, but can
> still write to /dev/tty.
>
> --
> Mark J. Reed <email@hidden>
>
--
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/archives/applescript-users
This email sent to email@hidden