#29658 [Bgs->Opn]: #!php with paramters is broken

From: Date: Sat, 14 Aug 2004 03:01:20 +0000
Subject: #29658 [Bgs->Opn]: #!php with paramters is broken
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-64594@lists.php.net to get a copy of this message
ID: 29658 User updated by: xuefer at 21cn dot com Reported By: xuefer at 21cn dot com -Status: Bogus +Status: Open -Bug Type: CGI related +Bug Type: Feature/Change Request -Operating System: xp/linux +Operating System: xp+cygwin &linux PHP Version: 4.3.8 New Comment: changed to feature request updated os how about: #!/usr/bin/php -p "........" p means parameters (or -o options) and the string after it is parsed as command line options as shell do Previous Comments: ------------------------------------------------------------------------ [2004-08-13 19:21:04] wez@php.net #! is a unixy thing that is not supported on windows. Additionally, most OS's don't support more than a single parameter there. Not a PHP bug. ------------------------------------------------------------------------ [2004-08-13 19:04:41] xuefer at 21cn dot com Description: ------------ touch php.ini ./test | grep php.ini -i paramter works but -c not seems those spaces is not convert to '\0' sapi/cli/php_cli.c while ((c = php_getopt(argc, argv, OPTIONS, &php_optarg, &php_optind, 0))!=-1) { switch (c) { case 'c': cli_sapi_module.php_ini_path_override = strdup(php_optarg); /*debug*/ printf("%d %d '%s'\n", (int) php_optarg[0], strlen(php_opt_arg), php_optarg); break; case 'n': cli_sapi_module.php_ini_ignore = 1; break; } } got "32 2 ' .'" seems a problem of the shell if -c is ok to be left broken. -i shouldn't be working too but allowing options in #! is very useful Reproduce code: --------------- #!/usr/bin/php -i -c . // empty file Expected result: ---------------- Configuration File (php.ini) Path => /etc/php.ini Actual result: -------------- Configuration File (php.ini) Path => ./php.ini ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=29658&edit=1

« previous php.bugs (#64594) next »