|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #299 Supplying quoted arguments via system() or exec()
Submitted: 1998-04-22 01:24 UTC Modified: 1998-05-15 21:36 UTC
From: jpronk at linkalarm dot com Assigned:
Status: Closed Package: Other
PHP Version: 3.0 Release Candidate 3 OS: Solaris
Private report: No CVE-ID: None
 [1998-04-22 01:24 UTC] jpronk at linkalarm dot com
I can't seem to get quoted arguments to commands to execute and
return output with the system() or exec() commands.


system("script -name \"The Name Is\"",$returncode)

always returns a return a code of 1 and no output. I have tried using
combinations of single and double quotes, &quot, %20 for the
spaces. But no luck. 

Not sure if this is a bug or not, but the call in the unix
shell works just fine, but not using system() in php?


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [1998-05-15 21:36 UTC] zeev
It works fine for all of the tests I've put it through.
If you can provide us with a code snippet that demonstrates
the bug (including whatever PHP3 scripts or non-PHP3 scripts
are necessary) - please submita new bug report.
Here's a simple example that demonstrates that it works
#!/usr/local/bin/perl -w
print "${ARGV[0]}\n";

system("./ \"Hey there\"",$ret);
print "$ret\n";

Hey there

PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Mon May 23 23:05:47 2022 UTC