Sponsored Content
Full Discussion: usage of underscore in awk
Top Forums Shell Programming and Scripting usage of underscore in awk Post 302265655 by radoulov on Monday 8th of December 2008 05:47:52 AM
Old 12-08-2008
Could you give an example? I suppose it's a simple variable name without any special meaning (not like in Perl, for example).
 

10 More Discussions You Might Find Interesting

1. HP-UX

how can I find cpu usage memory usage swap usage and logical volume usage

how can I find cpu usage memory usage swap usage and I want to know CPU usage above X% and contiue Y times and memory usage above X % and contiue Y times my final destination is monitor process logical volume usage above X % and number of Logical voluage above can I not to... (3 Replies)
Discussion started by: alert0919
3 Replies

2. AIX

How to monitor the IBM AIX server for I/O usage,memory usage,CPU usage,network..?

How to monitor the IBM AIX server for I/O usage, memory usage, CPU usage, network usage, storage usage? (3 Replies)
Discussion started by: laknar
3 Replies

3. Shell Programming and Scripting

grep/awk usage

Hi everybody, i know this question is common on the forum and i've searched for my answer but haven't quite found it. I'm trying to extract some values from a number of log files which look like this: Peak Power Consumption: 0.20777 Watts Observed Average Power: 0.1414794247 Watts The... (9 Replies)
Discussion started by: aKiiY
9 Replies

4. UNIX for Dummies Questions & Answers

awk FS usage problem

Hi All, I have a question about the usage of FS in awk and i appreciate if you can help me sort out what i'm doing wrong. I have a file with info ; separated and i just want to print the o/p of all fields ($1 -> $8) to the screen. As you can see it is very simple but i'm facing an error. ... (5 Replies)
Discussion started by: Dendany83
5 Replies

5. Shell Programming and Scripting

Using of gsub function in AWK to replace space by underscore

I must design a UNIX script to monitor files whose size is over a threshold of 5 MB in a specific UNIX directory I meet a problem during the for loop in my script. Some file names contain spaces. ls -lrt | awk '$5>=5000000 && length($8)==5 {gsub(/ /,"_",$9); print};' -rw-r--r-- 1 was61 ... (2 Replies)
Discussion started by: Scofield38
2 Replies

6. Shell Programming and Scripting

Awk, function of underscore char.

Hello Friends, I would appreciate so much if you could explain how the underscores works at the following code? Sorry if it sounds a bit novice question. awk -F',' 'NR==FNR{_=1;next}!_{print}' exclude infile KR, Eagle (6 Replies)
Discussion started by: EAGL€
6 Replies

7. Shell Programming and Scripting

Usage of Int with NR in awk

Hello Everyone, I am new to awk and trying my hand with the diff codes and came across the below code today. It would be great if any of the Guru's help me to understand. awk '{filename = "sample_file" int((NR-1)/34) ".DAT"; print >> filename}' sample_file.DAT 34 is the no of lines each... (7 Replies)
Discussion started by: saratha14
7 Replies

8. Shell Programming and Scripting

Help with awk - Disk usage

Hi All, Would appreciate your help as to why the following code not showing the correct output. the issue is on the last else cause. I am trying to report on disk space based on percentage usage. for some reason, it's showing output as OK even thou disk space is 90% !!!! any ideas why? thanks!!... (2 Replies)
Discussion started by: xcod3r
2 Replies

9. Shell Programming and Scripting

awk usage

Hi I have a file like this user="joe" phone="4280919" duration=128 login=12/02/2016 ip-address=10.230.120.35 user="mary" phone="6352728" duration=23 login=16/02/2016 ip-address=10.123.231.54 I have to convert these to as follows (csv format) (Ignore Login field)... (6 Replies)
Discussion started by: Balav
6 Replies

10. Shell Programming and Scripting

awk split after second underscore in field

I am trying to split a tab-delimeted file using awk after the second _ in bold. The awk below is close but splits on the first _, and I am not sure how to use the second _. Thank you :). file chr1 92145889 92149424 NM_001195684_exon_0_10_chr1_92145900_r 0 - chr1 92161218 ... (4 Replies)
Discussion started by: cmccabe
4 Replies
ConfigReader(3) 					User Contributed Perl Documentation					   ConfigReader(3)

NAME
ConfigReader - Read directives from a configuration file. DESCRIPTION
The ConfigReader library is a set of classes which reads directives from a configuration file. The library is completely object oriented, and it is envisioned that parsers for new styles of configuration files can be easily added. ConfigReader::Spec encapsulates a specification for configuration directives. You can specify which directives can be in the configuration file, aliases for the directive, whether the directive is required or has a default value, and how to parse the directive value. Here's an example of how one directive might be specified: required $spec 'HomePage', 'new URI::URL'; This defines a required directive called 'HomePage'. To parse the value from the configuration file, the URI::URL::new() method will be called with the string value as its argument. If the directive name is a simple string, it will be used both to refer to the directive in the Perl program, and as the name in the con- figuration file. You can also specify an alias by using an array ref. For example, suppose you wanted to use "index" as the name of the directive in the configuration file, but to avoid confusion with Perl's index() function you wanted to refer to the directive inside the program as the "file_index". This will do the trick: ['file_index', 'index'] You can specify any number of aliases for the directive: ['file_index', 'index', 'file_index', 'contents', ...] The parsing function or method is called to translate the value string from the configuration file into the value used by the program. It can be specified in several different ways: code ref static method object method undefined You can also specify a default value to be used if a directive is not specified in the configuration file. string value code ref undefined ConfigReader::Values stores a set of directive values that have been read from a configuration file. It stores a reference to an associ- ated Spec as a member variable. Separating the specification from the values makes it possible to use a single specification for multiple sets of values. ConfigReader::DirectiveStyle implements a reader for a common style of configuration file. It is a subclass of ConfigReader::Values. Directive names are followed by their value, one per line: HomePage http://www.w3.org/ Services /etc/services perl v5.8.2 1996-02-14 ConfigReader(3)
All times are GMT -4. The time now is 11:30 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy