Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Move File Containing More Than two "-" at 3rd Line To New Directory Post 302943959 by RudiC on Thursday 14th of May 2015 09:28:16 AM
Old 05-14-2015
HOW did it miss the purpose?
This User Gave Thanks to RudiC For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`"

Hi Friends, Can any of you explain me about the below line of code? mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'` Im not able to understand, what exactly it is doing :confused: Any help would be useful for me. Lokesha (4 Replies)
Discussion started by: Lokesha
4 Replies

2. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

3. UNIX for Dummies Questions & Answers

script works well but displays " line 6: =: No such file or directory"

strange :) can you tell why?:cool: #!/bin/bash echo " enter your age " read age if ; then echo " you do not have to pay tax " elif ]; then echo " you are eligible for income tax " else echo " you dont have to pay tax " fi (3 Replies)
Discussion started by: me.
3 Replies

4. UNIX for Dummies Questions & Answers

look for file size greater than "0" of specific pattern and move those to another directory

Hi , i have some files of specific pattern ...i need to look for files which are having size greater than zero and move those files to another directory.. Ex... abc_0702, abc_0709, abc_782 abc_1234 ...etc need to find out which is having the size >0 and move those to target directory..... (7 Replies)
Discussion started by: dssyadav
7 Replies

5. Shell Programming and Scripting

Find lines with "A" then change "E" to "X" same line

I have a bunch of random character lines like ABCEDFG. I want to find all lines with "A" and then change any "E" to "X" in the same line. ALL lines with "A" will have an "X" somewhere in it. I have tried sed awk and vi editor. I get close, not quite there. I know someone has already solved this... (10 Replies)
Discussion started by: nightwatchrenba
10 Replies

6. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

7. Shell Programming and Scripting

Move a line containg "char" above line containing "xchar"

Okay, so I have a rather large text file and will have to process many more and this will save me hours of work. I'm not very good at scripting, so bear with me please. Working on Linux RHEL I've been able to filter and edit and clean up using sed, but I have a problem with moving lines. ... (9 Replies)
Discussion started by: rex007can
9 Replies

8. Shell Programming and Scripting

Failure: if grep "$Var" "$line" inside while read line loop

Hi everybody, I am new at Unix/Bourne shell scripting and with my youngest experiences, I will not become very old with it :o My code: #!/bin/sh set -e set -u export IFS= optl="Optl" LOCSTORCLI="/opt/lsi/storcli/storcli" ($LOCSTORCLI /c0 /vall show | grep RAID | cut -d " "... (5 Replies)
Discussion started by: Subsonic66
5 Replies

9. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies

10. AIX

Apache 2.4 directory cannot display "Last modified" "Size" "Description"

Hi 2 all, i have had AIX 7.2 :/# /usr/IBMAHS/bin/apachectl -v Server version: Apache/2.4.12 (Unix) Server built: May 25 2015 04:58:27 :/#:/# /usr/IBMAHS/bin/apachectl -M Loaded Modules: core_module (static) so_module (static) http_module (static) mpm_worker_module (static) ... (3 Replies)
Discussion started by: penchev
3 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 11:33 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy