Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A Little curl/script help, please



At 11:52 AM -0400 07/01/2002, Robert C Jacobson wrote:
>At 8:24 AM -0700 7/1/02, Marconi wrote:
>>I need to call curl to periodically retrieve a page via http and if a certain word or phrase is present, execute a shell script to start a carbon application.
>>
>>I'm guessing that the curl part is probably a one or two-liner for someone knowledgeable. Would anyone care to offer a generic script of the type:
>>
>>curl <URL> | [processing for the <magic words> ]
>>line to execute if magic words are present
>>
>>or something similar?
>>
>>This would need to run from cron without anyone logged in.
>
>one-liner:
>
>if [ `curl -s URL | grep -qi magic_word; echo $?` ]; then open -a Application ; fi
>
>Problem is, if noone is logged in, I don't think that Carbon application will launch.

Actually, it can be launched by a script including this line...

sudo /System/Library/Frameworks/Carbon.framework/Versions/Current/Support/LaunchCFMApp /Applications/path_to_application &

I'll give your one-liner a try. I just need to change "then open -a Application" to call my launcher script.

Thanks muchly.
_______________________________________________
macos-x-server mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/macos-x-server
Do not post admin requests to the list. They will be ignored.

References: 
 >A Little curl/script help, please (From: Marconi <email@hidden>)
 >Re: A Little curl/script help, please (From: Robert C Jacobson <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.