Sponsored Content
Full Discussion: Multi pattern selection
Top Forums Shell Programming and Scripting Multi pattern selection Post 303000446 by sam_bd on Wednesday 12th of July 2017 09:49:15 AM
Old 07-12-2017
Thanks R.Singh.
Code:
awk -F"=" '/SName/{VAL=$0;next} /ESys/{print VAL,$0}'   Input_file

This code looks to be working on my first try. Input file is just what i've mentioned in my first question post. In the input file the above mentioned pattern repeats with different SName and ESys values. I'm trying to understand this code; VAL=$0. will this hold SName values?
 

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

how can awk match multi pattern in a string

Hi all, I need to category the processes in my system with awk. And for now, there are several command with similar name, so i have to match more than one pattern to pick it out. for instance: binrundb the string1, 2 & 3 may contain word, number, blank or "/". The "bin" should be ahead "rundb"... (5 Replies)
Discussion started by: sleepy_11
5 Replies

2. Shell Programming and Scripting

Sed or awk : pattern selection based on special characters

Hello All, I am here again scratching my head on pattern selection with special characters. I have a large file having around 200 entries and i have to select a single line based on a pattern. I am able to do that: Code: cat mytest.txt | awk -F: '/myregex/ { print $2}' ... (6 Replies)
Discussion started by: usha rao
6 Replies

3. Shell Programming and Scripting

Print between multi line pattern

Hi, I have a file with text like this .SET WIDTH 10000 .SET MAXERROR 1 insert into new_db SELECT * FROM some_db ; +---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+- .SET WIDTH 10000... (3 Replies)
Discussion started by: sol_nov
3 Replies

4. Shell Programming and Scripting

Multi-line filtering based on multi-line pattern in a file

I have a file with data records separated by multiple equals signs, as below. ========== RECORD 1 ========== RECORD 2 DATA LINE ========== RECORD 3 ========== RECORD 4 DATA LINE ========== RECORD 5 DATA LINE ========== I need to filter out all data from this file where the... (2 Replies)
Discussion started by: Finja
2 Replies

5. Shell Programming and Scripting

How to substract selective values in multi row, multi column file (using awk or sed?)

Hi, I have a problem where I need to make this input: nameRow1a,text1a,text2a,floatValue1a,FloatValue2a,...,floatValue140a nameRow1b,text1b,text2b,floatValue1b,FloatValue2b,...,floatValue140b look like this output: nameRow1a,text1b,text2a,(floatValue1a - floatValue1b),(floatValue2a -... (4 Replies)
Discussion started by: nricardo
4 Replies

6. Shell Programming and Scripting

sed multiple multi line blocks of text containing pattern

Hi, I have a log file which has sessionids in it, each block in the log starts with a date entry, a block may be a single line or multiple lines. I need to sed (or awk) out the lines/blocks with that start with a date and include the session id. The files are large at several Gb. My... (3 Replies)
Discussion started by: andyatit
3 Replies

7. Shell Programming and Scripting

Replacing lines matching a multi-line pattern (sed/perl/awk)

Dear Unix Forums, I am hoping you can help me with a pattern matching problem. What am I trying to do? I want to replace multiple lines of a text file (that match a multi-line pattern) with a single line of text. These patterns can span several lines and do not always have the same number of... (10 Replies)
Discussion started by: thefang
10 Replies

8. Shell Programming and Scripting

How to find all the multi line pattern and redirecting it to a file?

I've a file like this {multi line ....... ....... pattern} { some other stuff ......... } {multi line ....... ....... pattern} { some other stuff ......... } and so on (2 Replies)
Discussion started by: aamir_raihan
2 Replies

9. UNIX for Beginners Questions & Answers

Scripting wpa_supplicant for multi-profile selection

Hi all. So, first of all my apologies for the noob question. I've searched around for a way to make use of bash arrays to perform what I need, but I'm struggling to understand which method would be better. So, I'm looking to get a bit more comfortable with scripting, hoping to use... (1 Reply)
Discussion started by: Techbart
1 Replies
CPUPOWER-SET(1) 						  cpupower Manual						   CPUPOWER-SET(1)

NAME
cpupower-set - Set processor power related kernel or hardware configurations SYNOPSIS
cpupower set [ -b VAL ] [ -s VAL ] [ -m VAL ] DESCRIPTION
cpupower set sets kernel configurations or directly accesses hardware registers affecting processor power saving policies. Some options are platform wide, some affect single cores. By default values are applied on all cores. How to modify single core configura- tions is described in the cpupower(1) manpage in the --cpu option section. Whether an option affects the whole system or can be applied to individual cores is described in the Options sections. Use cpupower info to read out current settings and whether they are supported on the system at all. Options --perf-bias, -b Sets a register on supported Intel processore which allows software to convey its policy for the relative importance of performance versus energy savings to the processor. The range of valid numbers is 0-15, where 0 is maximum performance and 15 is maximum energy efficiency. The processor uses this information in model-specific ways when it must select trade-offs between performance and energy efficiency. This policy hint does not supersede Processor Performance states (P-states) or CPU Idle power states (C-states), but allows software to have influence where it would otherwise be unable to express a preference. For example, this setting may tell the hardware how aggressively or conservatively to control frequency in the "turbo range" above the explicitly OS-controlled P-state frequency range. It may also tell the hardware how aggressively it should enter the OS requested C- states. This option can be applied to individual cores only via the --cpu option, cpupower(1). Setting the performance bias value on one CPU can modify the setting on related CPUs as well (for example all CPUs on one socket), because of hardware restrictions. Use cpupower -c all info -b to verify. This options needs the msr kernel driver (CONFIG_X86_MSR) loaded. --sched-mc, -m [ VAL ] --sched-smt, -s [ VAL ] --sched-mc utilizes cores in one processor package/socket first before processes are scheduled to other processor packages/sockets. --sched-smt utilizes thread siblings of one processor core first before processes are scheduled to other cores. The impact on power consumption and performance (positiv or negativ) heavily depends on processor support for deep sleep states, fre- quency scaling and frequency boost modes and their dependencies between other thread siblings and processor cores. Taken over from kernel documentation: Adjust the kernel's multi-core scheduler support. Possible values are: 0 - No power saving load balance (default value) 1 - Fill one thread/core/package first for long running threads 2 - Also bias task wakeups to semi-idle cpu package for power savings SEE ALSO
cpupower-info(1), cpupower-monitor(1), powertop(1) AUTHORS
--perf-bias parts written by Len Brown <len.brown@intel.com> Thomas Renninger <trenn@suse.de> 22/02/2011 CPUPOWER-SET(1)
All times are GMT -4. The time now is 10:29 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy