Sponsored Content
Full Discussion: Shell parameters
Top Forums UNIX for Dummies Questions & Answers Shell parameters Post 12368 by ls1429 on Friday 28th of December 2001 07:22:24 AM
Old 12-28-2001
Shell Parameters

Yeah thatz it.
One more thing. But I am not clear why the ; after condition is really needed or not

if [ $# -ne 1 ]
then
echo "Provide one Parameter "
exit 1
fi

Thanks
LS1429
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Number of parameters to a shell script

Is there any restriction on number of parameters can be passed on to the shell script? I found, after 9th parameter for parameter 10, it is taking parameter 1. (1 Reply)
Discussion started by: videsh77
1 Replies

2. UNIX for Dummies Questions & Answers

Call a UNIX shell with parameters from C

Hello...I hava quite a problem, couldn't find a solution anywhere :(. I have a C program, and from that C program I have to call a shell script. This is not difficult, I can do it using the "system" command from C. But the ugly part is how can I send as parameters some variables? For example...i... (1 Reply)
Discussion started by: dustman
1 Replies

3. Shell Programming and Scripting

Accessing the parameters of a shell script

Hi, I have one situation. I am developing a shell script to which parameters will be passed from a Web based User Interface using some Business Process(BP).There are some 6 parameters for which user will enter the values in UI. These values will be passed to script by BP in the form -... (2 Replies)
Discussion started by: The Observer
2 Replies

4. Shell Programming and Scripting

Handling parameters in Shell Functions

Hi, Please help me with the below situation where I have to handle the parameters passed to a function in a unique way. Below is the code, which I am trying to execute. I basically want to pass the parameter to a function, where I am trying to get user input into array(s). I want to name... (7 Replies)
Discussion started by: bharath.gct
7 Replies

5. Shell Programming and Scripting

Parameters + arrays in unix shell

Say I have ./param HEY What would I do if I wanted to store each character into an array? Example. ARRAY1="H" ARRAY1="E" ARRAY1="Y" thank you! (5 Replies)
Discussion started by: puttster
5 Replies

6. UNIX for Dummies Questions & Answers

shell script with parameters?

hi , I wanted to create a script, and I have no idea how to, and I would appreciate any help on that. Any advice on solving this is welcome. Thanks Here it goes: make a shell script in bash that show the activity of users. The results should be a summary or a complete report in a file.... (2 Replies)
Discussion started by: ubu-user
2 Replies

7. Programming

csh: Parameters in Shell Script Help

I have a program that is designed to take the first parameter (a file extension) and use it to rewrite the file stored in the second paramerter with the new extension. And if the current file does not exist then the program will print an error message "No such file." For example, my program is... (1 Reply)
Discussion started by: Marhsall34
1 Replies

8. Homework & Coursework Questions

Positional Parameters Shell Scripting

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: STEP 1: Create a Bash shell script (myscript) inside the a2 directory. The script should allow the user to pass... (3 Replies)
Discussion started by: tazb
3 Replies

9. Shell Programming and Scripting

How can I fetch few parameters in Shell script?

Hi All, I want to fetch few details out of a huge output of AWS CLI tools : I am using this command : ec2-describe-instances (6 Replies)
Discussion started by: Palak Sharma
6 Replies
EXIT(3) 								 1								   EXIT(3)

exit - Output a message and terminate the current script

SYNOPSIS
void exit ([string $status]) DESCRIPTION
void exit (int $status) Terminates execution of the script. Shutdown functions and object destructors will always be executed even if exit is called. exit is a language construct and it can be called without parentheses if no $status is passed. PARAMETERS
o $status - If $status is a string, this function prints the $status just before exiting. If $status is an integer, that value will be used as the exit status and not printed. Exit statuses should be in the range 0 to 254, the exit status 255 is reserved by PHP and shall not be used. The status 0 is used to terminate the program successfully. Note PHP >= 4.2.0 does NOT print the $status if it is an integer. RETURN VALUES
No value is returned. EXAMPLES
Example #1 exit example <?php $filename = '/path/to/data-file'; $file = fopen($filename, 'r') or exit("unable to open file ($filename)"); ?> Example #2 exit status example <?php //exit program normally exit; exit(); exit(0); //exit with an error code exit(1); exit(0376); //octal ?> Example #3 Shutdown functions and destructors run regardless <?php class Foo { public function __destruct() { echo 'Destruct: ' . __METHOD__ . '()' . PHP_EOL; } } function shutdown() { echo 'Shutdown: ' . __FUNCTION__ . '()' . PHP_EOL; } $foo = new Foo(); register_shutdown_function('shutdown'); exit(); echo 'This will not be output.'; ?> The above example will output: Shutdown: shutdown() Destruct: Foo::__destruct() NOTES
Note Because this is a language construct and not a function, it cannot be called using variable functions. Note This language construct is equivalent to die(3). SEE ALSO
register_shutdown_function(3). PHP Documentation Group EXIT(3)
All times are GMT -4. The time now is 09:50 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy