LinuxQuestions.org
Visit Jeremy's Blog.
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 07-16-2011, 12:54 PM   #1
swathikumar
LQ Newbie
 
Registered: May 2011
Posts: 9

Rep: Reputation: Disabled
How to pass file content through URL using shell script


Hi All,

I am calling a URL from shell script and passing few argumants,
Here i have to pass file content as one argument.

How can i pass file content through URL.

eg:
content=`cat /Users/test1.txt`
open http://localhost:8080?filecontent=$content

it is not working.

Please give me solution for this.

Thanks
SwathiKumar
 
Old 07-16-2011, 02:50 PM   #2
kasl33
Member
 
Registered: Oct 2004
Location: USA
Distribution: Ubuntu-Server, Mac OS X, Arch Linux
Posts: 356

Rep: Reputation: 48
I'm guessing you're passing it to a Php script? I'm not sure how it would work on the shell script side, but here is what you would do on the Php side:

content=`cat /Users/test1.txt`


Code:
<?php
if(isset($_GET['filecontent'])){
  $content = $_GET['filecontent'];

  echo $content;

}
?>
We can at least start at this point if you haven't gotten this far.
 
  


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
Need help writing Unix Shell script to pass file name,path,creation date ! windjashi Programming 4 10-08-2009 01:59 AM
shell script for changing a txt file content Flobsi Linux - Newbie 3 10-06-2006 04:10 AM
shell script for changig txt-file content Flobsi Programming 1 10-05-2006 06:46 PM
modify content in a file using shell script fjkum Linux - Newbie 2 08-03-2006 05:46 AM
Shell script: substitute a file's content according to a map? Chowroc Programming 11 11-15-2005 05:08 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:38 PM.

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