Sponsored Content
Top Forums Shell Programming and Scripting error when call function in bash script Post 302395852 by ahmad.diab on Wednesday 17th of February 2010 06:36:07 AM
Old 02-17-2010
try below :-

Code:
function refills {
    echo "formatting refills and telepin" >> $log
    awk -F, '{print $7","$1","$2","$3","$5","$6","$9","$10","$11","$12","$13","$14","$15","$16","$17","$18","$20","$21","$22","$23","$24","$25","$26","$27","$28","$29","$30","$31","$32","$33","$34","$35","$36","$37","$38","$39","$40","$41","$42","$43","$44","$45","$46","$47","$48","$49","$50","$51","$52","$53","$54","$55","$56","$57","$58","$59","$60","$61","$62}' $func_path/$func_tmp > $func_path/$func_out 2>> $log
}
.
.
.
.

#to call the function

refills;

 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

i want to call a oracle function in my shell script

i want to call a oracle function in my shell script (4 Replies)
Discussion started by: dineshr85
4 Replies

2. Shell Programming and Scripting

how can i call a function in shell script

i have a function written in one shell script and i want to call that function in another shell script and use the value returned by that script. can any one suggest me how can i do that? regards, Rajesh.P (4 Replies)
Discussion started by: rajesh.P
4 Replies

3. Shell Programming and Scripting

Bash: how to call function having it's name in variable?

Hello. Looking for a method of modularizing my bash script, I am stuck with such a problem. For example, I have: MODULE_NAME="test" FUNCTION_NAME="run" How do I can a function with name test_run? (4 Replies)
Discussion started by: FractalizeR
4 Replies

4. Web Development

Fatal Error: Call to undefined function imagefilter()

I am using PHP5 in ubuntu 9.10. First I installed PHP and GD as separate package. I tried doing manipulation with images using php image function. When I try using the function imagefilter(), it was not worked and got the solution that need to compile the PHP with the bundled version of GD. So... (0 Replies)
Discussion started by: skg
0 Replies

5. Shell Programming and Scripting

Shell Script to call another function

Here is the following code : 1. # gcc -c test firstprog.c the above command will generate a executable file called "test " in which ever directory it is run. Assuming It will also return a value. 2. In the below SCRIPT . test is a file generated by compiling a c program... (3 Replies)
Discussion started by: Vabiosis
3 Replies

6. Shell Programming and Scripting

Script – Function Call

Hello, I have Individual function in my shell script , Function1 { Master activities } Function2 { Sub activities 1 } Function3 { Sub activities 2 } … (2 Replies)
Discussion started by: Shanks
2 Replies

7. Shell Programming and Scripting

Call function from another script

Hey, i got this 2 file. When i try to pick option 1, which is test1, it says ./test: test1: not found. Any idea on how i can fix it? #!/bin/sh QUIT=0 `dirname $0`/testfile while ; do testmenu read option case $option in 1) test1 ;; 2) test2 ;; 3) echo... (2 Replies)
Discussion started by: Nick1097
2 Replies

8. Shell Programming and Scripting

Call function as different user within the script

Hello For HP-UX, ksh shell, is it possible to define functions and call them by another user ? For example <function_name> ( ) { command1 command2 } su - <user> -c <function_name> Or the only option is defining the user in the function itself as follows - <function_name> ( )... (2 Replies)
Discussion started by: atanubanerji
2 Replies

9. Shell Programming and Scripting

awk call in bash function called with arugments not working, something lost in translation?

Hello, I have this awk code in a bash script to perform a find and replace task. This finds one unique line in a file and substitutes the found line with a replacement. #! /bin/bash # value determined elsewhere total_outputs_p1=100 # file being modified... (5 Replies)
Discussion started by: LMHmedchem
5 Replies
PMC.K7(3)						   BSD Library Functions Manual 						 PMC.K7(3)

NAME
pmc.k7 -- measurement events for AMD Athlon (K7 family) CPUs LIBRARY
Performance Counters Library (libpmc, -lpmc) SYNOPSIS
#include <pmc.h> DESCRIPTION
AMD K7 PMCs are present in the AMD Athlon series of CPUs and are documented in: AMD Athlon Processor x86 Code Optimization Guide, Publication No. 22007, Advanced Micro Devices, Inc., February 2002. PMC Features AMD K7 PMCs are 48 bits wide. Each K7 CPU contains 4 PMCs with the following capabilities: Capability Support PMC_CAP_CASCADE No PMC_CAP_EDGE Yes PMC_CAP_INTERRUPT Yes PMC_CAP_INVERT Yes PMC_CAP_READ Yes PMC_CAP_PRECISE No PMC_CAP_SYSTEM Yes PMC_CAP_TAGGING No PMC_CAP_THRESHOLD Yes PMC_CAP_USER Yes PMC_CAP_WRITE Yes Event Qualifiers Event specifiers for AMD K7 PMCs can have the following optional qualifiers: count=value Configure the counter to increment only if the number of configured events measured in a cycle is greater than or equal to value. edge Configure the counter to only count negated-to-asserted transitions of the conditions expressed by the other qualifiers. In other words, the counter will increment only once whenever a given condition becomes true, irrespective of the number of clocks during which the condition remains true. inv Invert the sense of comparison when the ``count'' qualifier is present, making the counter to increment when the number of events per cycle is less than the value specified by the ``count'' qualifier. os Configure the PMC to count events happening at privilege level 0. unitmask=mask This qualifier is used to further qualify a select few events, ``k7-dc-refills-from-l2'', ``k7-dc-refills-from-system'' and ``k7-dc-writebacks''. Here mask is a string of the following characters optionally separated by '+' characters: m Count operations for lines in the ``Modified'' state. o Count operations for lines in the ``Owner'' state. e Count operations for lines in the ``Exclusive'' state. s Count operations for lines in the ``Shared'' state. i Count operations for lines in the ``Invalid'' state. If no ``unitmask'' qualifier is specified, the default is to count events for caches lines in any of the above states. usr Configure the PMC to count events occurring at privilege levels 1, 2 or 3. If neither of the ``os'' or ``usr'' qualifiers were specified, the default is to enable both. AMD K7 Event Specifiers The event specifiers supported on AMD K7 PMCs are: k7-dc-accesses (Event 40H) Count data cache accesses. k7-dc-misses (Event 41H) Count data cache misses. k7-dc-refills-from-l2 [,unitmask=mask] (Event 42H) Count data cache refills from L2 cache. This event may be further qualified using the ``unitmask'' qualifier. k7-dc-refills-from-system [,unitmask=mask] (Event 43H) Count data cache refills from system memory. This event may be further qualified using the ``unitmask'' qualifier. k7-dc-writebacks [,unitmask=mask] (Event 44H) Count data cache writebacks. This event may be further qualified using the ``unitmask'' qualifier. k7-hardware-interrupts (Event CFH) Count the number of taken hardware interrupts. k7-ic-fetches (Event 80H) Count instruction cache fetches. k7-ic-misses (Event 81H) Count instruction cache misses. k7-interrupts-masked-cycles (Event CDH) Count the number of cycles when the processor's IF flag was zero. k7-interrupts-masked-while-pending-cycles (Event CEH) Count the number of cycles interrupts were masked while pending due to the processor's IF flag being zero. k7-l1-and-l2-dtlb-misses (Event 46H) Count L1 and L2 DTLB misses. k7-l1-dtlb-miss-and-l2-dtlb-hits (Event 45H) Count L1 DTLB misses and L2 DTLB hits. k7-l1-itlb-misses (Event 84H) Count L1 ITLB misses that are L2 ITLB hits. k7-l1-l2-itlb-misses (Event 85H) Count L1 (and L2) ITLB misses. k7-misaligned-references (Event 47H) Count misaligned data references. k7-retired-branches (Event C2H) Count all retired branches (conditional, unconditional, exceptions and interrupts). k7-retired-branches-mispredicted (Event C3H) Count all mispredicted retired branches. k7-retired-far-control-transfers (Event C6H) Count retired far control transfers. k7-retired-instructions (Event C0H) Count all retired instructions. k7-retired-ops (Event C1H) Count retired ops. k7-retired-resync-branches (Event C7H) Count retired resync branches (non control transfer branches). k7-retired-taken-branches (Event C4H) Count retired taken branches. k7-retired-taken-branches-mispredicted (Event C5H) Count mispredicted taken branches that were retired. Event Name Aliases The following table shows the mapping between the PMC-independent aliases supported by Performance Counters Library (libpmc, -lpmc) and the underlying hardware events used. Alias Event branches k7-retired-branches branch-mispredicts k7-retired-branches-mispredicted dc-misses k7-dc-misses ic-misses k7-ic-misses instructions k7-retired-instructions interrupts k7-hardware-interrupts unhalted-cycles (unsupported) SEE ALSO
pmc(3), pmc.atom(3), pmc.core(3), pmc.core2(3), pmc.iaf(3), pmc.k8(3), pmc.p4(3), pmc.p5(3), pmc.p6(3), pmc.soft(3), pmc.tsc(3), pmclog(3), hwpmc(4) HISTORY
The pmc library first appeared in FreeBSD 6.0. AUTHORS
The Performance Counters Library (libpmc, -lpmc) library was written by Joseph Koshy <jkoshy@FreeBSD.org>. BSD
October 4, 2008 BSD
All times are GMT -4. The time now is 05:09 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy