Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
Scripting a cron job to post data to a url via variable
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="masaka___" data-source="post: 21478"><p><strong>Watch closely</strong>:</p><p></p><p>curl -s http://www.remotebox.com/myIP.php?ip_data=`curl -s <a href="http://www.showmyip.com/simple/" target="_blank">http://www.showmyip.com/simple/</a> | awk '{print $1}'`</p><p></p><p>It's all about the back-tick ` located on the top-left corner of your keyboard. Surrounding a shell expression in back-ticks will execute the expression and return its output as a string. It's a very useful shell idiom.</p><p></p><p>That being said, there are easier ways to find your own IP address. For example, you could run the ifconfig command instead of using curl to ask a website to tell you your own IP address. (Silly Mac people. <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite9" alt=":eek:" title="Eek! :eek:" loading="lazy" data-shortname=":eek:" />)</p></blockquote><p></p>
[QUOTE="masaka___, post: 21478"] [b]Watch closely[/b]: curl -s http://www.remotebox.com/myIP.php?ip_data=`curl -s [url]http://www.showmyip.com/simple/[/url] | awk '{print $1}'` It's all about the back-tick ` located on the top-left corner of your keyboard. Surrounding a shell expression in back-ticks will execute the expression and return its output as a string. It's a very useful shell idiom. That being said, there are easier ways to find your own IP address. For example, you could run the ifconfig command instead of using curl to ask a website to tell you your own IP address. (Silly Mac people. :o) [/QUOTE]
Verification
Post reply
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
Scripting a cron job to post data to a url via variable
Top