Sponsored Content
Full Discussion: Function not found error
Top Forums UNIX for Dummies Questions & Answers Function not found error Post 302943630 by zaxxon on Monday 11th of May 2015 08:31:05 AM
Old 05-11-2015
The function needs to be defined, before you call it the first time. So put it above the for-loop.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Installer script -- function not found error

I am writing an installation script on AIX. This involves typical checks of some pre requisites like java, oracle, some version checks, disk space etc. It is a long script. I am facing a strange problem. There are a no of functions used in the script. What I see is that the installer complains of... (1 Reply)
Discussion started by: asutoshch
1 Replies

2. Shell Programming and Scripting

not found error

Hi I have to move data to a file based on the valuies of first three characters in a file I am using the following script FIN=$LOC/TEST.TXT FEEDFILE=$LOC/TUE_GROSSJE.TXT #Read the file while read FDROW do FEEDROW=$FDROW; DTYPE=`echo $FEEDROW |cut -c 1-3` if ; then $FEEDROW... (4 Replies)
Discussion started by: gander_ss
4 Replies

3. Shell Programming and Scripting

Error in functions : file2: function: not found

Hi I had written the small script for calling a function. bash-2.03$ more file2 function sai { echo " this is an example" } echo "This is main program" echo "calling the function" sai() when executing the above script. I am getting error. bash-2.03$ sh file2 file2: function:... (2 Replies)
Discussion started by: padarthy
2 Replies

4. Shell Programming and Scripting

procedure/function not found in .ksh

Hi all , I am getting an error "job_procfile not found" while excecuting a .ksh script. The script is used to create control-m ( scheduler ) jobs dynamically by reading parameter files ( flat filescomma seperated ) job_procfile is a function within the .ksh script The script is something... (8 Replies)
Discussion started by: rajesh_ramaoz
8 Replies

5. Shell Programming and Scripting

function: not found error on solaris

shell script in very simple, #!/bin/sh function msgs { echo 'this' } msgs It works on linux, apple, but can not run on solaris. On solaris, when I enter "./t.sh", it gave me following error, ./t.sh: function: not found this ./t.sh: msgs: not found What's wrong with... (3 Replies)
Discussion started by: microstarwwx
3 Replies

6. Shell Programming and Scripting

Function not found message

I have shell script as below: #!/bin/ksh #set -xv function set_variable { VARIABLE_NAME=$1 CURRENT_PATH=`pwd` if ; then echo "\nconfiguration_file.lst file not found in $CURRENT_PATH/common/common_scripts" exit 1; fi VARIABLE_COUNT=`cat... (2 Replies)
Discussion started by: findprakash
2 Replies

7. Shell Programming and Scripting

sh: gzip: not found ERROR

I am creating a script to run the SysInfo tool under HPUX servers, this is my script! #!/usr/bin/ksh # # Date: February 29th 2011 # #Definicion de variables PATH_TMP=/home/eponcede > HPUX_SysInfo.log for host in `cat $PATH_TMP/servers/host_hp2_test` do echo... (2 Replies)
Discussion started by: eponcedeleonc
2 Replies

8. Shell Programming and Scripting

Bash script fails with "function: not found" error

Hello everyone, I am having problems figuring this out. This script below is supposed to create a list of file names with their "md5sum", in a file "lib-list.txt" When I run it "sh component-list.sh " I get this:component-list.sh: 4: component-list.sh: function: not found component-list.sh:... (4 Replies)
Discussion started by: joemb
4 Replies

9. Shell Programming and Scripting

Command not found, but using function in bash

In the bash below, if the answer is "y" then goto function remove. If the answer is "n" then goto the id variable line (where the date is inputted). However, I am getting command remove not found, but remove is a function not an command. I must have the syntax incorrect? Thank you :). ... (3 Replies)
Discussion started by: cmccabe
3 Replies

10. Shell Programming and Scripting

Bash to search file for string and lauch function if found

In the bash below I am searching the filevirus-scan.log for the Infected files: 0 line (in bold) and each line for OK. If both of these are true then the function execute is automatically called and processing starts. If both these conditions are not meet then the line in the file is sent to the... (2 Replies)
Discussion started by: cmccabe
2 Replies
Net::SIP::Dispatcher::Eventloop(3pm)			User Contributed Perl Documentation		      Net::SIP::Dispatcher::Eventloop(3pm)

NAME
Net::SIP::Dispatcher::Eventloop - simple event loop for Net::SIP::Dispatcher SYNOPSIS
my $loop = Net::SIP::Dispatcher::Eventloop->new; $loop->addFD( $fd, $callback ); $loop->add_timer( 10,$callback ); $loop->loop; DESCRIPTION
The package implements a simple event loop. It's not optimized for speed but it is provided as a simple implementation in case the users application does not has an event loop yet. Because the eventloop object can be given in the constructor of Net::SIP::Dispatcher you might provide an alternative implementation, which implemented the described methods. CONSTRUCTOR
new Creates new event loop, returns created object METHODS
addFD ( HANDLE, CALLBACK, ?NAME ) Adds file handle HANDLE to the event loop, so that CALLBACK gets triggered if HANDLE is readable. CALLBACK is a callback accepted by invoke_callback in Net::SIP::Util. The callback will be invoked with HANDLE as an additional argument. NAME can be used to aid debugging, it will be shown in the debug messages once the FD gets ready. If there was already a callback for HANDLE it gets replaced by the new one. IMPORTANT NOTE: CALLBACK gets triggered if HANDLE *is* readable inside the loop, not if HANDLE *gets* readable. Unlike with Event::Lib or similar the CALLBACK is not triggered by the edge, but by the level (like poll(2) or select(2)). So if 2 bytes come in at the handle and one reads only 1 byte in the callback the callback gets triggered again for more data. You have to watch this, if you want to integrate Net::SIP with your existing event loop. delFD ( HANDLE ) Removes HANDLE from loop, e.g. no more checking for readability will be done. add_timer( WHEN, CALLBACK, [ REPEAT ] ) Adds timer which gets triggered at WHEN or "now + WHEN". Depending on the value of WHEN it gets interpreted as the number of seconds since 1970-01-01 (when it's really big) or as a relative time (when it's not that big). WHEN can be floating point for subseconds resolution. CALLBACK is a callback accepted by invoke_callback in Net::SIP::Util. It gets invoked with the timer object (see later) as an additional argument, which has a method cancel for canceling the (repeating) timer. REPEAT is the number of seconds between each invocation of the timer. If greater then 0 (subsection resulution possible) the callback will be called each REPEAT seconds, after it was called the first time at WHEN. The method will return an object which has a method cancel which can be used to cancel the timer before it gets triggered (or gets triggered the next time in case of repeating timers). looptime Returns the current loop time in subseconds resolution (using gettimeofday from Time::HiRes). This is not the current time, but the time, when the last event in the loop occured (e.g. when the select(2) call returned) loop ( [ TIMEOUT, @STOPVAR ] ) The main loop, e.g. continuiosly checks timers and file handles for the events and calls callbacks. If TIMEOUT is given it will run the loop for at most TIMEOUT seconds, then the method will return. Undefined TIMEOUT means that it will never return because of timeout and TIMEOUT of 0 means that it will check all timers and handles only once and then return. @STOPVAR is a list of scalar references. These scalars are expected to be changed from the callbacks, so it will check after each loop cycle, e.g. after all callbacks are called (timers and handles) if any of these scalars is TRUE, in which case it will end the loop. The behavior with STOPVAR cannot be found in most existing event loops. If you want to integrate Net::SIP with your own event loop you migth simply wrap all callbacks given in addFD and add_timer in another callback which at the end checks the stopvars and terminates the 3rd-party loop in a loop-specific way. perl v5.14.2 2009-01-23 Net::SIP::Dispatcher::Eventloop(3pm)
All times are GMT -4. The time now is 10:03 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy