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
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 usage, storage usage? (3 Replies)
Discussion started by: laknar
3 Replies
3. Shell Programming and Scripting
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
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
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
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
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
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
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
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
LEARN ABOUT CENTOS
perl::critic::policy::variables::prohibitpunctuationvars
Perl::Critic::Policy::Variables::ProhibitPunctuationVarsUser Contributed Perl DocumentaPerl::Critic::Policy::Variables::ProhibitPunctuationVars(3)
NAME
Perl::Critic::Policy::Variables::ProhibitPunctuationVars - Write "$EVAL_ERROR" instead of "$@".
AFFILIATION
This Policy is part of the core Perl::Critic distribution.
DESCRIPTION
Perl's vocabulary of punctuation variables such as $!, $., and $^ are perhaps the leading cause of its reputation as inscrutable line
noise. The simple alternative is to use the English module to give them clear names.
$| = undef; #not ok
use English qw(-no_match_vars);
local $OUTPUT_AUTOFLUSH = undef; #ok
CONFIGURATION
The scratch variables $_ and @_ are very common and are pretty well understood, so they are exempt from this policy. The same goes for the
less-frequently-used default filehandle "_" used by stat(). All the regexp capture variables ($1, $2, ...) are exempt too. $] is exempt
because there is no English equivalent and Module::CoreList is based upon it.
You can add more exceptions to your configuration. In your perlcriticrc file, add a block like this:
[Variables::ProhibitPunctuationVars]
allow = $@ $!
The "allow" property should be a whitespace-delimited list of punctuation variables.
Other configuration options control the parsing of interpolated strings in the search for forbidden variables. They have no effect
on detecting punctuation variables outside of interpolated strings.
[Variables::ProhibitPunctuationVars]
string_mode = thorough
The option "string_mode" controls whether and how interpolated strings are searched for punctuation variables. Setting "string_mode =
thorough", the default, checks for special cases that may look like punctuation variables but aren't, for example $#foo, an array
index count; $$bar, a scalar dereference; or $::baz, a global symbol.
Setting "string_mode = disable" causes all interpolated strings to be ignored entirely.
Setting "string_mode = simple" uses a simple regular expression to find matches. In this mode, the magic variables $$, "$'", $# and $:
are ignored within interpolated strings due to the high risk of false positives. Simple mode is retained from an earlier draft of
the interpolated- strings code. Its use is only recommended as a workaround if bugs appear in thorough mode.
The "string_mode" option will go away when the parsing of interpolated strings is implemented in PPI. See "CAVEATS" below.
BUGS
Punctuation variables that confuse PPI's document parsing may not be detected correctly or at all, and may prevent detection of
subsequent ones. In particular, $" is known to cause difficulties in interpolated strings.
CAVEATS
ProhibitPunctuationVars relies exclusively on PPI to find punctuation variables in code, but does all the parsing itself for
interpolated strings. When, at some point, this functionality is transferred to PPI, ProhibitPunctuationVars will cease doing the
interpolating and the "string_mode" option will go away.
AUTHOR
Jeffrey Ryan Thalhammer <jeff@imaginative-software.com>
COPYRIGHT
Copyright (c) 2005-2011 Imaginative Software Systems. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of this license
can be found in the LICENSE file included with this module.
perl v5.16.3 2014-06-09 Perl::Critic::Policy::Variables::ProhibitPunctuationVars(3)