How can I invoke a shell script with parameters from within a PHP script? For example, from within my web-based PHP script, I want to execute the command "/home/cscgal/script.sh -f foo"
Dani 4,675 The Queen of DaniWeb Administrator Featured Poster Premium Member
Recommended Answers
Jump to Postwouldnt you use the system() or exec() commands?
http://www.php.net/manual/en/function.exec.php
http://www.php.net/manual/en/function.system.php
Jump to PostI haven't used these but that is the way I read it, only differences in output. The command part is a string so I assume you can use variables normally in the command.
Dance
All 8 Replies
big_k105 11 PFO Founder Team Colleague
Dani 4,675 The Queen of DaniWeb Administrator Featured Poster Premium Member
DanceInstructor 19 Posting Whiz
RamiroS 0 Junior Poster in Training
mehra 0 Newbie Poster
carobee 0 Posting Whiz in Training
RamiroS 0 Junior Poster in Training
carobee 0 Posting Whiz in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.