Sponsored Content
Full Discussion: Positional parameter passing
Top Forums Shell Programming and Scripting Positional parameter passing Post 302387257 by pludi on Friday 15th of January 2010 03:31:29 AM
Old 01-15-2010
There are 2 more:
  • $* holds all parameters passed in one variable
  • $@ is an array of all parameters passed.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

parameter passing

Hallo everyone, This is my problem below: /home/cerebrus/pax=>vat class2.sh ksh: vat: not found /home/cerebrus/pax=>cat class2.sh #!/bin/ksh set -x bdf|grep appsdev|awk '{ print $5 }'> class3 dd={cat class3} echo $dd /home/cerebrus/pax=> /home/cerebrus/pax=>./class2.sh + bdf +... (8 Replies)
Discussion started by: kekanap
8 Replies

2. AIX

ls positional parameter

Hi . I am new to Unix. So i have a tough time. we are using Korn Shell. I have a scenario where i have three files namely xxx01,xxx02,xxx03. Now when i write ls xxx*|wc -l output is 3. But then i write `ls $1|wc -l` and pass xxx* as positional parameter (sh yyy.sh xxx*) output is xxx01. other... (1 Reply)
Discussion started by: vasuarjula
1 Replies

3. Shell Programming and Scripting

ls positional parameter

Hi . I am new to Unix. So i have a tough time. we are using Korn Shell. I have a scenario where i have three files namely xxx01,xxx02,xxx03. Now when i write ls xxx*|wc -l output is 3. But then i write `ls $1|wc -l` and pass xxx* as positional parameter (sh yyy.sh xxx*) output is xxx01. other... (1 Reply)
Discussion started by: vasuarjula
1 Replies

4. Shell Programming and Scripting

Passing asterisk As A Parameter

I have written a Shell Script Program which accepts 3 parameters as shown below: ./calc 20 + 2 in the above line ./calc is the Shell Script itself with 3 parameters, namely: 20 + and 2. Well, now let's look inside the Script: result=$1$2$3 echo $result The output will be as... (8 Replies)
Discussion started by: indiansoil
8 Replies

5. Shell Programming and Scripting

Parameter Passing problem

Hi All, I developed a KSH script which will accept two parameters as input. These two parameters are some directories paths. In the script i am validating the number of paramaters it received as below #-------------------------------------- # Check Command line arguments... (8 Replies)
Discussion started by: Raamc
8 Replies

6. Shell Programming and Scripting

Passing parameter in quotes

Hi, PW='/as sysdba'; export PW in other module I call sqlplus ${PW} (this line I unable to change!) How I can define PW so that sqlplus calls PW in quotes i.e sqlplus '/as sysdba' I tried like this PW="'/as sysdba'"; export PW - no luck Thanks in advance (2 Replies)
Discussion started by: zam
2 Replies

7. Shell Programming and Scripting

Define Positional Parameter Range Awk

Hello All, I am trying to clean up a poorly looking awk command. I am searching for a way to define a range of positional parameters. I may not be searching for the correct syntax. Example: awk ' /14:3*/ {print $2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13}' app.log Is it possible to shorten... (4 Replies)
Discussion started by: jaysunn
4 Replies

8. Shell Programming and Scripting

Extracting unknown positional parameter in Bourne shell

I have a variable that contains the number of a positional parameter. There is no way of knowing what number this may be, although it is guaranteed to correspond with a valid parameter. In BASH I could just use ${@} to extract that argument. But in a Bourne shell the best I can come up with is... (3 Replies)
Discussion started by: mij
3 Replies

9. Shell Programming and Scripting

Passing parameter to script, and split the parameter

i am passing input parameter 'one_two' to the script , the script output should display the result as below one_1two one_2two one_3two if then echo " Usage : <$0> <DATABASE> " exit 0 else for DB in 1 2 3 do DBname=`$DATABASE | awk -F "_" '{print $1_${DB}_$2}` done fi (5 Replies)
Discussion started by: only4satish
5 Replies

10. Shell Programming and Scripting

Passing parameter more than 9

Hi, I've written a script where eleven parameter to be passed from command line which is inserting into an oracle table, it is working but the tenth and 11th parameter are not accepting as given it is referring to 1st parameter. HERE IS THE SCRIPT #!/bin/ksh #set -o echo $*... (4 Replies)
Discussion started by: sankar
4 Replies
Prima::EventHook(3)					User Contributed Perl Documentation				       Prima::EventHook(3)

NAME
Prima::EventHook - event filtering SYNOPSIS
use Prima::EventHook; sub hook { my ( $my_param, $object, $event, @params) = @_; ... print "Object $object received event $event "; ... return 1; } Prima::EventHook::install( &hook, param => $my_param, object => $my_window, event => [qw(Size Move Destroy)], children => 1 ); Prima::EventHook::deinstall(&hook); DESCRIPTION
Prima dispatches events by calling notifications registered on one or more objects interested in the events. Also, one event hook can be installed that would receive all events occurred on all objects. "Prima::EventHook" provides multiplex access to the core event hook and introduces set of dispatching rules so the user hook subs receive only a defined subset of events. The filtering criteria are event names and object hierarchy. API
install SUB, %RULES Installs SUB into hook list using hash of RULES. The SUB is called with variable list of parameters, formed so first passed parameters from 'param' key ( see below ), then event source object, then event name, and finally parameters to the event. SUB must return an integer, either 0 or 1, to block or pass the event, respectively. If 1 is returned, other hook subs are called; if 0 is returned, the event is efficiently blocked and no hooks are further called. Rules can contain the following keys: event Event is either a string, an array of strings, or "undef" value. In the latter case it is equal to '*' string, which selects all events to be passed in the SUB. A string is either name of an event, or one of pre-defined event groups, declared in %groups package hash. The group names are: ability focus geometry keyboard menu mouse objects visibility These contain respective events. See source for detailed description. In case 'event' key is an array of strings, each of the strings is also name of either an event or a group. In this case, if '*' string or event duplicate names are present in the list, SUB is called several times which is obviously inefficient. object A Prima object, or an array of Prima objects, or undef; the latter case matches all objects. If an object is defined, the SUB is called if event source is same as the object. children If 1, SUB is called using same rules as described in 'object', but also if the event source is a child of the object. Thus, selecting "undef" as a filter object and setting 'children' to 0 is almost the same as selecting $::application, which is the root of Prima object hierarchy, as filter object with 'children' set to 1. Setting together object to "undef" and children to 1 is inefficient. param A scalar or array of scalars passed as first parameters to SUB whenever it is called. deinstall SUB Removes the hook sub for the hook list. NOTES
"Prima::EventHook" by default automatically starts and stops Prima event hook mechanism when appropriate. If it is not desired, for example for your own event hook management, set $auto_hook to 0. AUTHOR
Dmitry Karasik, <dmitry@karasik.eu.org>. SEE ALSO
Prima, Prima::Object perl v5.14.2 2009-02-24 Prima::EventHook(3)
All times are GMT -4. The time now is 03:56 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy