hi
i have a function
abc
{
//from this function i am passing args to antoher function like
def a b c j k l
}
now i want to count the no of args coming to def() function and iterate over those values
is there any way to do this one
please help (2 Replies)
Hi All,
I am trying to pass an argument called "Pricelist" to a Perl function, then the function will open and print out the contents of the file named "Pricelist". But i can't seem to do it using my below code. Can any expert give some advice?
#!/usr/local/bin/perl
$DATABASE =... (1 Reply)
Hi,
I have a function in shell script
fun1{ echo "No.of arguments are..."}
this function will be called in same script by passing arguments
fun 1 2 3
I want to check the no. of arguments passed to fun1 function in the same functionbefore validation.
can any one suggest me. (2 Replies)
Hi,
I've a logging function in bourne shell, flog() which logs the first argument passed to it. How can I pass arguments to this function from a file, like
cat filename | sed '...filtering...' | flog
or
cat filename | sed '...filtering...' | xargs flog
Which did not work, after which... (3 Replies)
Hi Guys,
I am trying to pass arguments to the script i am wrinting.
When no argument is passed or wrong argument is passed, the script needs to output the way it needs to be called and exit.
Currently, when no arguments is passed, it is not getting exited but goes on assuming those... (3 Replies)
I have trouble getting this logic to work
#!/bin/bash
function assign_var(){
while
do
read -p "$2 :" $3
done
}
assign_var '$IPADDRESS' ipaddress IPADDRESS
Basicly, i want to make sure that entry is made (i can add more sophisticated checks later), but the idea is to recycle... (11 Replies)
I need to call a function within a code with $database and $ service as the arguments How do I proceed ? and how would a function be defined and these two arguments would be used inside the function?
calc_pref_avail $database $service
Best regards,
Vishal (7 Replies)
Hello Everyone,
Is there a way i can pass the arguments as parameters or variables instead of positional arguments to a function, below i am calling the function defined in a script.
Call:
notify "Error While Generating The List File: ${GEN_PARAM_LIST9} For Feed Data Validation Errors In... (1 Reply)
I'm reading Wicked Cool Shell Scripts. For some reason, the function pasted in below gives the error: ./inpath2: line 10: in_path()
4 {
5 cmd=$1 ourpath=$2 result=1
6 oldIFS=$IFS IFS=":"
7
8 for directory in "$ourpath"
9 do
10 if ; then
11 result=0
12 fi... (9 Replies)
I have a script that uses 2 arguments. I want to call the function part within this script using these same arguments. Below is what I came up with below script so far, any guidance would be helpful. Thank you!
cat backup.sh
#!/bin/bash
function usage {
echo "USAGE: $(basename $0)... (6 Replies)
Discussion started by: mbak
6 Replies
LEARN ABOUT DEBIAN
sigwait
SIGWAIT(2) BSD System Calls Manual SIGWAIT(2)NAME
sigwait -- select a set of signals
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <signal.h>
int
sigwait(const sigset_t * restrict set, int * restrict sig);
DESCRIPTION
The sigwait() system call selects a set of signals, specified by set. If none of the selected signals are pending, sigwait() waits until one
or more of the selected signals has been generated. Then sigwait() atomically clears one of the selected signals from the set of pending
signals for the process and sets the location pointed to by sig to the signal number that was cleared.
The signals specified by set should be blocked at the time of the call to sigwait().
If more than one thread is using sigwait() to wait for the same signal, no more than one of these threads will return from sigwait() with the
signal number. If more than a single thread is blocked in sigwait() for a signal when that signal is generated for the process, it is
unspecified which of the waiting threads returns from sigwait(). If the signal is generated for a specific thread, as by pthread_kill(),
only that thread will return.
Should any of the multiple pending signals in the range SIGRTMIN to SIGRTMAX be selected, it will be the lowest numbered one. The selection
order between realtime and non-realtime signals, or between multiple pending non-realtime signals, is unspecified.
RETURN VALUES
If successful, sigwait() returns 0 and sets the location pointed to by sig to the cleared signal number. Otherwise, an error number is
returned.
ERRORS
The sigwait() system call will fail if:
[EINVAL] The set argument specifies one or more invalid signal numbers.
[EFAULT] Any arguments point outside the allocated address space or there is a memory protection fault.
SEE ALSO sigaction(2), sigpending(2), sigqueue(2), sigsuspend(2), sigtimedwait(2), sigwaitinfo(2), pause(3), pthread_sigmask(3)STANDARDS
The sigwait() function conforms to ISO/IEC 9945-1:1996 (``POSIX.1'').
BSD November 11, 2005 BSD