Sponsored Content
Top Forums Shell Programming and Scripting How to pass position parameter into function.? Post 302922559 by neutronscott on Sunday 26th of October 2014 02:53:08 PM
Old 10-26-2014
use "$@" to pass along every parameter
This User Gave Thanks to neutronscott For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Position independent Parameter passing

Hi all, When parameters are passed to the shell script, they are dereferenced by their position. For example, I call myTest.sh and pass two parameters param1 and param2 as following: ./myTest.sh param1 param2 In the script, myTest.sh, I refer to first parameter (param1 ) as $1 and second... (1 Reply)
Discussion started by: sonaluphale
1 Replies

2. Shell Programming and Scripting

How to pass a parameter

Hi all, How to pass a parameter from a oracle pl/sql procedure parameter to shell environment and use it? (1 Reply)
Discussion started by: megh
1 Replies

3. Shell Programming and Scripting

pass parameter to function

HI all I have a code like ############################################## minyear() { curryear=$1 echo $curryear } ##Main Program ## minyear exit ####### when i execute "sh scriptname 2005" output should be like 2005 but the output is blank. I guess i need to pass parameter to... (3 Replies)
Discussion started by: vasuarjula
3 Replies

4. Shell Programming and Scripting

What is the maximum number of parameter we can pass to a shell script function?

what is the maximum number of parameter we can pass to a shell script function (8 Replies)
Discussion started by: alokjyotibal
8 Replies

5. Shell Programming and Scripting

How to pass parameter to User defined function in shell script?

Hello, Can anyone guide me tin passing parameters into user defined function of shell script (KSH). Here is my code, InsertRecord() { DB_TBL=$(sqlplus $USERID/$PASSWORD@$DATABASE << EOF set head off set feed off set serveroutput on INSERT INTO TBL1 ( OLD_VAL, NEW_VAL, ... (7 Replies)
Discussion started by: Poonamol
7 Replies

6. Shell Programming and Scripting

Pass command as a function parameter

Hi guys, can someome help with this question, I have defined a function that takes a command as a parameter, but when the command is executed from the function it will throw errors because what I believe is a special character escaping issue. I tried using the backslash to escape the pipe | and >... (2 Replies)
Discussion started by: marouanix
2 Replies

7. Shell Programming and Scripting

How to pass a function with a variable parameter into another variable?

Hello again :) Am currently trying to write a function which will delete a record from a file. The code currently looks as such: function deleteRecord() { clear read -p "Please enter the ID of the record you wish to remove: " strID ... (2 Replies)
Discussion started by: U_C_Dispatj
2 Replies

8. Shell Programming and Scripting

How to use this position parameter?

Hi Gurus, I want split one huge line file to multiple line, I got code from you guys yesterday. I want put the code in a script which use two position parameter when run the script. my code like: awk '{for (i=1; i<=length($0); i+=$2) print substr($0, i, $2)}' $1 > $1_split when I run the... (6 Replies)
Discussion started by: ken6503
6 Replies

9. Shell Programming and Scripting

How to pass function parameter to do loop?

Hi All, I have created one function for KSH and was running well with one parameter input since I just had to use $1 to get the parameter. Now I want to do loop for each parameter(actually filenames) . I have try to use do loop, but $i does not resolve to parameter instead it resolves to 1,... (5 Replies)
Discussion started by: mysocks
5 Replies

10. Homework & Coursework Questions

How to Dynamically Pass Parameter to plsql Function & Capture its Output Value in a Shell Variable?

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: 2. Relevant commands, code, scripts, algorithms: #! /bin/ksh v="ORG_ID" ... (2 Replies)
Discussion started by: sujitdas2104
2 Replies
Net::DBus::Callback(3pm)				User Contributed Perl Documentation				  Net::DBus::Callback(3pm)

NAME
Net::DBus::Callback - a callback for receiving reactor events SYNOPSIS
use Net::DBus::Callback; # Assume we have a 'terminal' object and its got a method # to be invoked everytime there is input on its terminal. # # To create a callback to invoke this method one might use my $cb = Net::DBus::Callback->new(object => $terminal, method => "handle_stdio"); # Whatever is monitoring the stdio channel, would then # invoke the callback, perhaps passing in a parameter with # some 'interesting' data, such as number of bytes available $cb->invoke($nbytes) #... which results in a call to # $terminal->handle_stdio($nbytes) DESCRIPTION
This module provides a simple container for storing details about a callback to be invoked at a later date. It is used when registering to receive events from the Net::DBus::Reactor class. NB use of this module in application code is no longer neccessary and it remains purely for backwards compatability. Instead you can simply pass a subroutine code reference in any place where a callback is desired. METHODS
my $cb = Net::DBus::Callback->new(method => $name, [args => @args]) Creates a new callback object, for invoking a plain old function. The "method" parameter should be the fully qualified function name to invoke, including the package name. The optional "args" parameter is an array reference of parameters to be pass to the callback, in addition to those passed into the "invoke" method. my $cb = Net::DBus::Callback->new(object => $object, method => $name, [args => @args]) Creates a new callback object, for invoking a method on an object. The "method" parameter should be the name of the method to invoke, while the "object" parameter should be a blessed object on which the method will be invoked. The optional "args" parameter is an array reference of parameters to be pass to the callback, in addition to those passed into the "invoke" method. $cb->invoke(@args) Invokes the callback. The argument list passed to the callback is a combination of the arguments supplied in the callback constructor, followed by the arguments supplied in the "invoke" method. AUTHOR
Daniel P. Berrange. COPYRIGHT
Copyright (C) 2004-2011 Daniel P. Berrange SEE ALSO
Net::DBus::Reactor perl v5.14.2 2011-06-30 Net::DBus::Callback(3pm)
All times are GMT -4. The time now is 12:49 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy