• 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: "cd " and "tail -f" on a file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "cd " and "tail -f" on a file


  • Subject: Re: "cd " and "tail -f" on a file
  • From: Andrew Oliver <email@hidden>
  • Date: Mon, 17 Mar 2003 06:56:48 -0800

A couple of points to note:

Since the path name contains spaces, you need to use 'quoted form of POSIX
path' to get a shell-safe version of the path suitable for using in a shell.
As it stands, you're trying to run:

cd Cymbal of Desire/Users/blahblahblah

Whereas you need to:

cd Cymbal\ of\ Desire/Users/blahblahblah

'quoted form of' will perform this translation for you.

Second, although you're in a 'tell application "Terminal"' block, you're
using 'do shell script' which is a standard addition. Therefore the command
will execute in a new background shell, not in the terminal.
Terminal.app's command for running a shell script/command is "do script"

Andrew
:)

On 3/17/03 6:45 AM, "Todd Reid" <email@hidden> wrote:

> Andrew,
> Thanks for your input...yeah, I know that I can tail the output to a
> variable (although don't really need to...I'll just read the output of the
> file being tailed in the Terminal), but the trouble I'm running into is with
> the path contruction.
>
> Here's where I'm at currently:
>
> tell application "Terminal"
> set x to POSIX path of (alias "Cymbal of
> Desire:Users:treid:DailyBuilds:2003-03-14_build1428 English:AppName:AppName
> Application Support:AppName Engine:logs:")
> do shell script "cd " & x
> end tell
>
> Running this returns the error "Terminal got an error: An error of type 1
> has occurred."
>
> Any ideas?
>
> Many thanks,
>
> Todd
>
> On 3/17/03 7:16 AM, "Andrew Oliver" <email@hidden> wrote:
>
>> You mean like:
>>
>> tell application "Terminal"
>> do script "cd /some/path; tail filename.txt"
>> end tell
>>
>>
>> Presumably you do realize that you can:
>>
>> set someVar to do shell script "cd /some/path/; tail filename.txt"
>>
>> And read the tail output into an AppleScript variable, right?
>>
>> Andrew
>> :)
>>
>> On 3/17/03 6:06 AM, "Todd Reid" <email@hidden> wrote:
>>
>>> I9m wondering if anyone can assist me with a scripting need. I need to (via
>>> applescript, preferably) change directory and then tail a file in the
>>> Terminal.
>>>
>>> Any help is greatly appreciated...
>>>
>>> Todd
>>>
>>>
>>>
>>>
>>> Creo | Creative Software Group
>>> todd reid | quality assurance engineer | +1.720.932.4718
>>> email@hidden | http://www.creo.com/sixdegrees
>>>
>>> IMAGINE CREATE BELIEVE
>>> _______________________________________________
>>> 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.
>>
>
>
>
>
>
> Creo | Creative Software Group
> todd reid | quality assurance engineer | +1.720.932.4718
> email@hidden | http://www.creo.com/sixdegrees
>
> IMAGINE CREATE BELIEVE
_______________________________________________
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.

  • Follow-Ups:
    • Re: "cd " and "tail -f" on a file
      • From: Todd Reid <email@hidden>
References: 
 >Re: "cd " and "tail -f" on a file (From: Todd Reid <email@hidden>)

  • Prev by Date: Re: "cd " and "tail -f" on a file
  • Next by Date: Re: scripting "Mail"
  • Previous by thread: Re: "cd " and "tail -f" on a file
  • Next by thread: Re: "cd " and "tail -f" on a file
  • Index(es):
    • Date
    • Thread