Sponsored Content
Top Forums Shell Programming and Scripting Passing arguments to php script Post 302976935 by stomp on Friday 8th of July 2016 12:36:29 PM
Old 07-08-2016
That's the way how this is be done:

Code:
someprogram_that_creates_php_code_on_stdout | php -- $1 $2 ...

Had to use google too, to find out how it is done....

Last edited by stomp; 07-08-2016 at 03:50 PM..
This User Gave Thanks to stomp For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Passing arguments to a script

I've written a script (bgrep) for a more advanced grep command (& attached a cut down version below). I'm trying allow all grep options to be used, or in any combination. The script works fine if I type say bgrep -i -files product it will return a non-case sensitive list of matches for... (3 Replies)
Discussion started by: Kevin Pryke
3 Replies

2. Shell Programming and Scripting

Passing arguments to a Perl script

I am playing around with Perl and wrote the script below that is executed from the command line, it will split data up in a file based on a value supplied. When executed you provide two arguments - the file that contains the data to be split and the character you want to split by. It works as... (4 Replies)
Discussion started by: jyoung
4 Replies

3. UNIX for Advanced & Expert Users

Passing blank arguments to a script

All, I have a cron job script that receives several command line arguments. At some point if there are validation problems and the job cannot be run, it duplicates the entire command line into a temporary text file which is later executed as a script. Unfortunately when I pass the list of received... (7 Replies)
Discussion started by: rm-r
7 Replies

4. Shell Programming and Scripting

passing runtime arguments to a shell script...

hi I am new to shell programming.....my question is while running one of my shell program it stops in between to accept input from the user and proceeds furthur after giving input....I want to know whether I can set this input through some files so that the shell acript reads the input from the... (10 Replies)
Discussion started by: santy
10 Replies

5. Shell Programming and Scripting

problem passing arguments to script

Hi, I am writing a script, which is invoked from other system using ssh. I have problems reading the arguments passing to the script. If the argument has a space in it (ex "rev 2.00"), the script considers "rev" as 1 argument and "2.00" as another. Instead i want "rev 2.00" to be considered... (5 Replies)
Discussion started by: cjjoy
5 Replies

6. Shell Programming and Scripting

passing arguments to sql script

Hi Gurus, i have one requirement in unix script, i have a file called abc.txt in that few lines are there with the empid, i need to read each line and pass to .sql script. ex: abc.txt 2345 2346 1243 1234 i need to pass these arguments to .sql script rom unix ex: select * from... (1 Reply)
Discussion started by: Devendar
1 Replies

7. Shell Programming and Scripting

passing arguments to external script

Hi! I have a python script that requires arguments and these arguments are file paths. This script works fine when executed like this: /my_python_script "file_path1" "file_path2" (i added quotes as some file names may have weird characters) the issue happens when i launch my python script... (14 Replies)
Discussion started by: gigagigosu
14 Replies

8. Shell Programming and Scripting

Passing arguments to a perl script

Hi I need to pass comma seperated arguments to a perl script? It is like: Exect.pl -d GUI1,GUI2,GUI3 and I need to store these argsGUI1,GUI2,GUI3 in an array. can anyone suggest how to do that: (1 Reply)
Discussion started by: rkrish
1 Replies

9. Shell Programming and Scripting

Passing arguments to a bash script

Hi, I wanted to pass an argument to a bash script. So that the argument is used inside the awk command inside the bash script. I know the noraml way of passing argument to a bash script as below : sh myScript.sh abc Inside the bash script i can use like this myArg1=$1 wc $myArg But... (8 Replies)
Discussion started by: shree11
8 Replies

10. Shell Programming and Scripting

Passing arguments while running the script

Hi, I have a requirement for creating a MQ (queue) where the inputs has to be passed as arguments. Running the script as below ./hi.sh "Servername" "QueueManagername" "QueuecreationCommand" cat hi.sh echo "Welcome to $1" runmqsc $2 < $3 But the queue creation command is... (9 Replies)
Discussion started by: Anusha M
9 Replies
FUNC_NUM_ARGS(3)							 1							  FUNC_NUM_ARGS(3)

func_num_args - Returns the number of arguments passed to the function

SYNOPSIS
int func_num_args (void ) DESCRIPTION
Gets the number of arguments passed to the function. This function may be used in conjunction with func_get_arg(3) and func_get_args(3) to allow user-defined functions to accept variable- length argument lists. RETURN VALUES
Returns the number of arguments passed into the current user-defined function. CHANGELOG
+--------+---------------------------------------------------+ |Version | | | | | | | Description | | | | +--------+---------------------------------------------------+ | 5.3.0 | | | | | | | This function can now be used in parameter | | | lists. | | | | | 5.3.0 | | | | | | | If this function is called from the outermost | | | scope of a file which has been included by call- | | | ing include(3) or require(3) from within a func- | | | tion in the calling file, it now generates a | | | warning and returns -1. | | | | +--------+---------------------------------------------------+ ERRORS
/EXCEPTIONS Generates a warning if called from outside of a user-defined function. EXAMPLES
Example #1 func_num_args(3) example <?php function foo() { $numargs = func_num_args(); echo "Number of arguments: $numargs "; } foo(1, 2, 3); ?> The above example will output: Number of arguments: 3 Example #2 func_num_args(3) example before and after PHP 5.3 test.php <?php function foo() { include './fna.php'; } foo('First arg', 'Second arg'); ?> fna.php <?php $num_args = func_num_args(); var_export($num_args); ?> Output previous to PHP 5.3: 2 Output in PHP 5.3 and later will be something similar to: Warning: func_num_args(): Called from the global scope - no function context in /home/torben/Desktop/code/ml/fna.php on line 3 -1 NOTES
Note Because this function depends on the current scope to determine parameter details, it cannot be used as a function parameter in ver- sions prior to 5.3.0. If this value must be passed, the results should be assigned to a variable, and that variable should be passed. SEE ALSO
... syntax in PHP 5.6+, func_get_arg(3), func_get_args(3), ReflectionFunctionAbstract::getNumberOfParameters. PHP Documentation Group FUNC_NUM_ARGS(3)
All times are GMT -4. The time now is 03:37 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy