Sponsored Content
Full Discussion: If statement
Top Forums Shell Programming and Scripting If statement Post 302898171 by protocomm on Saturday 19th of April 2014 02:29:38 PM
Old 04-19-2014
it miss the [] around the command if
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

If statement

Hi, I have a statement in shell script which i am writing below: if ] then ..... What is the meaning of -a option in files, meaning of the statement in the if condition ] means. Thanks (3 Replies)
Discussion started by: dreams5617
3 Replies

2. Shell Programming and Scripting

if statement

can someone please tell me what is wrong with the below. i'm trying to get a script to run if the content of a variable is either small letter y or capital letter Y. if then whatever fi (4 Replies)
Discussion started by: Terrible
4 Replies

3. Shell Programming and Scripting

statement

I want to write a program that would convert yard to feet and feet to yard. i.e 1 yard = 3 * feet Echo "enter a" read a expr a *3 The trick is that I want to give the user some options. After the conversion from yard to feet is done, I want to ask the user whether or not he/she wants to... (10 Replies)
Discussion started by: Ernst
10 Replies

4. Shell Programming and Scripting

If statement - How to write a null statement

In my ksh script, if the conditions of a if statement are true, then do nothing; otherwise, execute some commands. How do I write the "do nothing" statement in the following example? Example: if (( "$x"="1" && "$y"="a" && "$z"="happy" )) then do nothing else command command fi... (3 Replies)
Discussion started by: april
3 Replies

5. Shell Programming and Scripting

How is use sselect statement o/p in insert statement.

Hi All, I am using Unix ksh script. I need to insert values to a table using the o/p from a slelect statement. Can anybody Help! My script looks like tihs. ---`sqlplus -s username/password@SID << EOF set heading off set feedback off set pages 0 insert into ${TB_NAME}_D... (2 Replies)
Discussion started by: nkosaraju
2 Replies

6. UNIX for Dummies Questions & Answers

If statement (yes or no)

I have the program: #!/bin/ksh echo Please enter yes or no read n typeset -l n if ] then echo My name exit else echo delete my name fi Question: How can I make the program accept only the word "yes" or "no" otherwise it will ask the user to re-enter? Thanks! (7 Replies)
Discussion started by: bobo
7 Replies

7. Shell Programming and Scripting

If statement help

I'm trying to create a script that would allow me to identify the sucessful removal of a file. Here's what i put together so far, let me know if it's correct or not. FILE_NAME="cactus.dat" FILE_FIND='find / -name $FILE_NAME' if ;then echo "cactus.dat was not removed successfully" ... (3 Replies)
Discussion started by: sdpinoy
3 Replies

8. Shell Programming and Scripting

Statement

${PFILE}.backupfile Please tell me what the above statement means? (1 Reply)
Discussion started by: lg123
1 Replies

9. Shell Programming and Scripting

If statement

Hi, I have this code here. Its suppose to do something when certain condition is met, I'm pretty sure at least one of the condition will be meet somewhere in the loop but it always go to else part of the script. Is something wrong on this script? age_list=`tar -tvf /home/dir/$tarfile... (4 Replies)
Discussion started by: erin00
4 Replies

10. Shell Programming and Scripting

Convert Update statement into Insert statement in UNIX using awk, sed....

Hi folks, I have a scenario to convert the update statements into insert statements using shell script (awk, sed...) or in database using regex. I have a bunch of update statements with all columns in a file which I need to convert into insert statements. UPDATE TABLE_A SET COL1=1 WHERE... (0 Replies)
Discussion started by: dev123
0 Replies
PMC(3)							   BSD Library Functions Manual 						    PMC(3)

NAME
pmc_configure_counter, pmc_start_counter, pmc_stop_counter, pmc_get_num_counters, pmc_get_counter_class, pmc_get_counter_type, pmc_get_counter_value, pmc_get_accumulated_counter_value, pmc_get_counter_class_name, pmc_get_counter_type_name, pmc_get_counter_event_name, pmc_get_counter_event_list -- performance counter interface library LIBRARY
Performance Counters Library (libpmc, -lpmc) SYNOPSIS
#include <pmc.h> int pmc_configure_counter(int ctr, const char *evname, pmc_ctr_t reset_val, uint32_t flags); int pmc_start_counter(int ctr); int pmc_stop_counter(int ctr); int pmc_get_num_counters(void); int pmc_get_counter_class(void); int pmc_get_counter_type(int ctr, int *typep); int pmc_get_counter_value(int ctr, uint64_t *valp); int pmc_get_accumulated_counter_value(int ctr, uint64_t *valp); const char * pmc_get_counter_class_name(int class); const char * pmc_get_counter_type_name(int type); const char * pmc_get_counter_event_name(pmc_evid_t event); const struct pmc_event * pmc_get_counter_event_list(void); DESCRIPTION
The pmc library is an interface to performance monitoring counters available on some CPUs. The pmc library can count events on the following CPU families. Each second-level entry describes a performance counter class. A given class may apply to multiple individual CPU models. Each class has one or more counter types. A CPU may have more than one counter of a given type. Refer to the corresponding processor programmer's manual for more information about individual events. o ARM o Intel i80200 (PMC_CLASS_I80200) There are two types of counters available in this class: PMC_TYPE_I80200_CCNT cycle counter PMC_TYPE_I80200_PMCx performance counter The following events may be counted by a counter of type PMC_TYPE_I80200_CCNT: clock clock-div-64 The following events may be counted by a counter of type PMC_TYPE_I80200_PMCx: insfetch-miss insfetch-stall datadep-stall itlb-miss dtlb-miss branch-taken branch-mispredicted instruction-executed dcachebufffull-stall-time dcachebufffull-stall-count dcache-access dcache-miss dcache-writeback swchange-pc bcu-mem-request bcu-queue-full bcu-queue-drain bcu-ecc-no-elog bcu-1bit-error narrow-ecc-caused-rmw o i386 o Intel i586 (PMC_CLASS_I586) There are two types of counters available in this class: PMC_TYPE_I586_TSC cycle counter PMC_TYPE_I586_PMCx performance counter The following events may be counted by a counter of type PMC_TYPE_I586_PMCx: tlb-data-miss tlb-ins-miss l1cache-ins-miss l1cache-data-miss l1cache-data-miss-read l1cache-data-miss-write l1cache-writeback l1cache-writeback-hit l2cache-data-snoop l2cache-data-snoop-hit mem-read mem-write mem-access mem-access-both-pipes mem-bank-conflicts mem-misalign-ref mem-uncached-read seg-load-any branch branch-btb-hit branch-taken ins-read ins-pipeline-flush ins-executed ins-executed-vpipe ins-stall-agi ins-stall-write ins-stall-data ins-stall-writeline bus-utilization bus-locked bus-io-cycle fpu-flops int-hw break-match0 break-match1 break-match2 break-match3 o Intel i686 (PMC_CLASS_I686) There are two types of counters available in this class: PMC_TYPE_I686_TSC cycle counter PMC_TYPE_I686_PMCx performance counter The following events may be counted by a counter of type PMC_TYPE_I686_PMCx: mem-refs l1cache-lines l1cache-mlines l1cache-mlines-evict l1cache-miss-wait ins-fetch ins-fetch-misses itlb-misses insfetch-mem-stall insfetch-decode-stall l2cache-insfetch l2cache-data-loads l2cache-data-stores l2cache-lines l2cache-lines-evict l2cache-mlines l2cache-mlines-evict l2cache-reqs l2cache-addr-strobes l2cache-data-busy l2cache-data-busy-read bus-drdy-clocks-self bus-drdy-clocks-any bus-lock-clocks-self bus-lock-clocks-any bus-req-outstanding-self bus-req-outstanding-any bus-burst-reads-self bus-burst-reads-any bus-read-for-ownership-self bus-read-for-ownership-any bus-write-back-self bus-write-back-any bus-ins-fetches-self bus-ins-fetches-any bus-invalidates-self bus-invalidates-any bus-partial-writes-self bus-partial-writes-any bus-partial-trans-self bus-partial-trans-any bus-io-trans-self bus-io-trans-any bus-deferred-trans-self bus-deferred-trans-any bus-burst-trans-self bus-burst-trans-any bus-total-trans-self bus-total-trans-any bus-mem-trans-self bus-mem-trans-any bus-recv-cycles bus-bnr-cycles bus-hit-cycles bus-hitm-cycles bus-snoop-stall fpu-flops fpu-comp-ops fpu-except-assist fpu-mul fpu-div fpu-div-busy mem-sb-blocks mem-sb-drains mem-misalign-ref ins-pref-dispatch-nta ins-pref-dispatch-t1 ins-pref-dispatch-t2 ins-pref-dispatch-weak ins-pref-miss-nta ins-pref-miss-t1 ins-pref-miss-t2 ins-pref-miss-weak ins-retired uops-retired ins-decoded ins-stream-retired-packed-scalar ins-stream-retired-scalar ins-stream-comp-retired-packed-scalar ins-stream-comp-retired-scalar int-hw int-cycles-masked int-cycles-masked-pending branch-retired branch-miss-retired branch-taken-retired branch-taken-mispred-retired branch-decoded branch-btb-miss branch-bogus branch-baclear stall-resource stall-partial seg-loads unhalted-cycles mmx-exec mmx-sat-exec mmx-uops-exec mmx-exec-packed-mul mmx-exec-packed-shift mmx-exec-pack-ops mmx-exec-unpack-ops mmx-exec-packed-logical mmx-exec-packed-arith mmx-trans-mmx-float mmx-trans-float-mmx mmx-assist mmx-retire seg-rename-stalls-es seg-rename-stalls-ds seg-rename-stalls-fs seg-rename-stalls-gs seg-rename-stalls-all seg-rename-es seg-rename-ds seg-rename-fs seg-rename-gs seg-rename-all seg-rename-retire o AMD Athlon / K7 (PMC_CLASS_K7) There are two types of counters available in this class: PMC_TYPE_K7_TSC cycle counter PMC_TYPE_K7_PMCx performance counter The following events may be counted by a counter of type PMC_TYPE_K7_PMCx: seg-load-all seg-load-es seg-load-cs seg-load-ss seg-load-ds seg-load-fs seg-load-gs seg-load-hs seg-load-stall l1cache-access l1cache-miss l1cache-refill l1cache-refill-invalid l1cache-refill-shared l1cache-refill-exclusive l1cache-refill-owner l1cache-refill-modified l1cache-load l1cache-load-invalid l1cache-load-shared l1cache-load-exclusive l1cache-load-owner l1cache-load-modified l1cache-writeback l1cache-writeback-invalid l1cache-writeback-shared l1cache-writeback-exclusive l1cache-writeback-owner l1cache-writeback-modified l2cache-access l2cache-tag-read l2cache-tag-write l2cache-inst-read l2cache-inst-load l2cache-data-store l2cache-data-loadmem l2cache-data-write l2cache-data-move l2cache-access-busy l2cache-hit l2cache-miss mem-misalign-ref mem-access mem-access-uc mem-access-wc mem-access-wt mem-access-wp mem-access-wb ins-fetch ins-fetch-miss ins-refill-l2 ins-refill-mem ins-fetch-stall ins-retired ins-empty itlb-miss-l1 itlb-miss-l2 ops-retired branch-retired branch-miss-retired branch-taken-retired branch-taken-miss-retired branch-far-retired branch-resync-retired branch-near-retired branch-near-miss-retired branch-indirect-miss-retired int-hw int-cycles-masked int-cycles-masked-pending break-match0 break-match1 break-match2 break-match3 The pmc library maintains a mapping between event names and the event selector used by the CPU's performance monitoring hardware. The map- ping is described by the following structure: struct pmc_event { const char *name; pmc_evid_t val; }; The pmc_configure_counter() function configures the counter ctr to count the event evname. The initial value of the counter will be set to reset_val, and this value will be loaded back into the counter each time it overflows. There are currently no flags defined for the flags argument. The pmc_start_counter() function enables counting on counter ctr. The pmc_stop_counter() function disables counting on counter ctr. The pmc_get_num_counters() function returns the number of counters present in the CPU. The pmc_get_counter_class() function returns the counter class of the CPU. The pmc_get_counter_type() function places the counter type of counter ctr into *typep. The pmc_get_counter_value() function places the total number of events counted by counter ctr into *valp. The pmc_get_accumulated_counter_value() function places the total number of events counted for the current process and all of its children by counter ctr into *valp. The pmc_get_counter_class_name() function returns the name of the counter class classval. The pmc_get_counter_type_name() function returns the name of the counter type type. The pmc_get_counter_event_name() function returns the name of the event event for the current CPU's performance counter class. The pmc_get_counter_event_list() function returns an array of pmc_event structures, listing the supported event types for the CPU. The array is terminated by and entry who's name member is NULL. RETURN VALUES
The pmc_configure_counter(), pmc_start_counter(), pmc_stop_counter(), pmc_get_counter_type(), pmc_get_counter_value(), and pmc_get_accumulated_counter_value() functions return 0 to indicate success and -1 to indicate failure, in which case errno(2) will be set to indicate the mode of failure. The pmc_get_counter_class_name(), pmc_get_counter_type_name(), pmc_get_counter_event_name(), and pmc_get_counter_event_list() functions return NULL and set errno(2) to indicate failure. SEE ALSO
pmc(1), pmc_control(2), pmc_get_info(2), pmc(9) HISTORY
The pmc library first appeared in NetBSD 2.0. AUTHORS
The pmc library was written by Jason R. Thorpe <thorpej@wasabisystems.com> and contributed by Wasabi Systems, Inc. BSD
August 8, 2002 BSD
All times are GMT -4. The time now is 01:46 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy