LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-20-2014, 02:06 PM   #1
NotionCommotion
Member
 
Registered: Aug 2012
Posts: 536

Rep: Reputation: Disabled
How does curl send a file to another program?


Please help me understand the following. My understanding is silently download the file at that URL, and pipe it to PHP? Does this make any sense? Thanks

Code:
curl -s http://getcomposer.org/installer | php
 
Old 09-20-2014, 02:52 PM   #2
coralfang
Member
 
Registered: Nov 2010
Location: Bristol, UK
Distribution: Slackware, FreeBSD
Posts: 384
Blog Entries: 2

Rep: Reputation: 96
Piped commands take the input from stdout. Basically it takes the output that would usually be printed to the terminal, but sends it to the piped command as stdin.

This might explain it better: https://workaround.org/linuxtip/pipes
 
Old 09-20-2014, 02:58 PM   #3
NotionCommotion
Member
 
Registered: Aug 2012
Posts: 536

Original Poster
Rep: Reputation: Disabled
Thanks coralfang,

The part that confused me was why pass something to PHP? After thinking more about it, does this just download some PHP script, and then have PHP execute it? Same thing as downloading the file, putting it in my HTML directory, and pointing the browser at it?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't send file attachment with curl patapout Linux - Newbie 0 08-10-2012 05:34 PM
How to send sms using wget or curl ? bobbera Linux - General 5 01-15-2012 12:14 PM
cURL: Server has many IPs, how would I make a cURL script use those IPs to send data? guest Programming 0 04-11-2009 12:42 PM
Is there a way to send files to a friend, similar to MSN send file protocol? pablom Linux - Networking 1 05-07-2007 11:16 PM
in Pascal: how to exec a program, discard text output or send to text file Valkyrie_of_valhalla Programming 6 05-02-2007 10:50 AM


All times are GMT -5. The time now is 06:29 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration