LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-03-2006, 05:54 PM   #1
kushalkoolwal
Senior Member
 
Registered: Feb 2004
Location: Middle of nowhere
Distribution: Debian Squeeze
Posts: 1,249

Rep: Reputation: 49
Passing a value from a shell script to a php file


Hi,

I have written a shell script and one of the steps of the shell script is to run a php file. Now I have a variable in my shell script called $path which has some value. Now what I would like to do is to pass this value to my php file which I am calling from my shell script. My shell script name is installer.sh and my php file name is installer.php. Here is some part of my shell script
Code:
#!/bin/bash

echo "blah blah"

#get the value
$PATH="/usr/local"

#call the php file
php installer.php
 
Old 06-03-2006, 06:04 PM   #2
graemef
Senior Member
 
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

Rep: Reputation: 148Reputation: 148
Look at example 43-1 it should help
 
Old 06-03-2006, 07:51 PM   #3
kushalkoolwal
Senior Member
 
Registered: Feb 2004
Location: Middle of nowhere
Distribution: Debian Squeeze
Posts: 1,249

Original Poster
Rep: Reputation: 49
Quote:
Originally Posted by graemef
Look at example 43-1 it should help
Yeah I had found the same page before but I could not figure where should I run my shell script from? Will my shell script and php file reside in the same file?

any help will be highly appreciated.
 
Old 06-03-2006, 08:58 PM   #4
kushalkoolwal
Senior Member
 
Registered: Feb 2004
Location: Middle of nowhere
Distribution: Debian Squeeze
Posts: 1,249

Original Poster
Rep: Reputation: 49
Ok i did found out the way. Thanks for the effort due. Really appreciate it.
 
Old 07-07-2010, 06:25 AM   #5
reyl
LQ Newbie
 
Registered: Jul 2010
Posts: 1

Rep: Reputation: 0
I'm having the same problem. May I know how you did 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
Passing parameters to a shell script neocookie Linux - General 5 10-20-2005 11:44 AM
passing parameters to functions in shell script kushalkoolwal Programming 1 09-28-2005 02:40 PM
Passing arguments to a shell script subu_s Programming 3 09-02-2005 05:13 AM
Passing variables from AWK script to my shell script BigLarry Programming 1 06-12-2004 04:32 AM
passing quotes in shell script Tenor Trombone Programming 1 04-18-2001 09:26 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:13 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
Open Source Consulting | Domain Registration