08-19-2013
Hi Rudic,
Sorry about that. I'm quite new to this world and didn't realize how important those little details are. I must have suspected it. Sorry for making you waste time on a "false" assumption. Will not happen next time.
Thanks so much.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Can some body tell me how to print number of line from a particular file, with sed. ?
Input file format
AAAA
BBBB
CCCC
SDFFF
DDDD
DDDD
Command to print line 2 and 3 ?
BBBB
CCCC
And also please tell me how to assign column sum to variable.
I user the following command it... (1 Reply)
Discussion started by: maheshsri
1 Replies
2. Shell Programming and Scripting
Hi,
I want to print only lines in between two strings and not the strings using awk.
Eg:
OUTPUT
top 2
bottom 1
left 0
right 0
page 66
END
I want to print into a new file only
top 2
bottom 1
left 0... (4 Replies)
Discussion started by: jisha
4 Replies
3. Shell Programming and Scripting
abc.dat
tty cpu
tin tout us sy wt id
0 0 7 3 19 71
extended device statistics
r/s w/s kr/s kw/s wait actv wsvc_t asvc_t %w %b device
0.0 133.2 0.0 682.9 0.0 1.0 0.0 7.2 0 79 c1t0d0
0.2 180.4 0.1 5471.2 3.0 2.8 16.4 15.6 15 52 aaaaaa1-xx
I want to skip first 5 line... (4 Replies)
Discussion started by: kchinnam
4 Replies
4. UNIX for Dummies Questions & Answers
Ok so I can use awk to match a pattern and print the whole line with print $0. Is there any way to just tell awk to print every line of output when the pattern matches?
I'm having it wait for the word error and then print that entire line. But what I actually need to see is all the following... (9 Replies)
Discussion started by: MrEddy
9 Replies
5. Shell Programming and Scripting
Dear All,
a.txt
A 1 Z
A 1 ZZ
B 2 Y
B 2 AA
how can i use awk one line to achieve the result:
A Z|ZZ
B Y|AA
Thanks (5 Replies)
Discussion started by: jimmy_y
5 Replies
6. Shell Programming and Scripting
I have a file1.txt
file1.txt
F-120009210","Felix","U-M-F-F-F-","white","yes","no","U-M-F-F-F-","Bristol","RI","true"
F-120009213","Fluffy","U-F-","white","yes","no","M-F-","Warwick","RI","true"
U-120009217","Lity","U-M-","grey","yes","yes","","Fall River","MA","true"... (4 Replies)
Discussion started by: charles33
4 Replies
7. Shell Programming and Scripting
I have a output log file, that I want to extract some temperature measurement data.
I want to AWK on the words "show chassis environment" in the original file, and extract that entire line, and then the 3rd to 10th lines after the one I AWK'd, into a seperate output file.
Here is an example... (3 Replies)
Discussion started by: HikerLT
3 Replies
8. Shell Programming and Scripting
im using the code below to monitor a file:
gawk '{
a += gsub("(^| )accepted( |$)", "&")
a += gsub("(^| )open database( |$)", "&")
} END {
for (i in a)
printf("%s=%s\n", i, a)
}' /var/log/syslog
the code is searching the syslog file for the string "accepted" and "open... (2 Replies)
Discussion started by: SkySmart
2 Replies
9. UNIX for Dummies Questions & Answers
URGENT HELP IS NEEDED!!
I am looking to move matching lines (01 - 07) from File1 and 77 tab the matching string from File2, to File3.txt. I am almost done but
- Currently, script is not printing lines to File3.txt in order.
- Also the matching lines are not moving out of File1.txt
... (1 Reply)
Discussion started by: High-T
1 Replies
10. Shell Programming and Scripting
from the CLI on a Mac, if you type networksetup -listallnetworkservices then you get results in a multi-line paragraph that look something like this:
networksetup -listallnetworkservices
An asterisk (*) denotes that a network service is disabled.
Wi-Fi
Display Ethernet
Bluetooth DUN... (7 Replies)
Discussion started by: hungryd
7 Replies
boolean(3pm) User Contributed Perl Documentation boolean(3pm)
NAME
boolean - Boolean support for Perl
SYNOPSIS
use boolean;
do &always if true;
do &never if false;
do &maybe if boolean($value)->isTrue;
and:
use boolean ':all';
$guess = int(rand(2)) % 2 ? true : false;
do &something if isTrue($guess);
do &something_else if isFalse($guess);
and:
use boolean -truth;
die unless ref(42 == 42) eq 'boolean';
die unless ("foo" =~ /bar/) eq '0';
DESCRIPTION
Most programming languages have a native "Boolean" data type. Perl does not.
Perl has a simple and well known Truth System. The following scalar values are false:
$false1 = undef;
$false2 = 0;
$false3 = 0.0;
$false4 = '';
$false5 = '0';
Every other scalar value is true.
This module provides basic Boolean support, by defining two special objects: "true" and "false".
RATIONALE
When sharing data between programming languages, it is important to support the same group of basic types. In Perlish programming
languages, these types include: Hash, Array, String, Number, Null and Boolean. Perl lacks native Boolean support.
Data interchange modules like YAML and JSON can now "use boolean" to encode/decode/roundtrip Boolean values.
FUNCTIONS
This module defines the following functions:
true
This function returns a scalar value which will evaluate to true. The value is a singleton object, meaning there is only one "true"
value in a Perl process at any time. You can check to see whether the value is the "true" object with the isTrue function described
below.
false
This function returns a scalar value which will evaluate to false. The value is a singleton object, meaning there is only one "false"
value in a Perl process at any time. You can check to see whether the value is the "false" object with the isFalse function described
below.
boolean($scalar)
Casts the scalar value to a boolean value. If $scalar is true, it returns "boolean::true", otherwise it returns "boolean::false".
isTrue($scalar)
Returns "boolean::true" if the scalar passed to it is the "boolean::true" object. Returns "boolean::false" otherwise.
isFalse($scalar)
Returns "boolean::true" if the scalar passed to it is the "boolean::false" object. Returns "boolean::false" otherwise.
isBoolean($scalar)
Returns "boolean::true" if the scalar passed to it is the "boolean::true" or "boolean::false" object. Returns "boolean::false"
otherwise.
METHODS
Since true and false return objects, you can call methods on them.
$boolean->isTrue
Same as isTrue($boolean).
$boolean->isFalse
Same as isFalse($boolean).
USE OPTIONS
By default this module exports the "true", "false" and "boolean" functions.
The module also defines these export tags:
:all
Exports "true", "false", "boolean", "isTrue", "isFalse", "isBoolean"
-truth
You can specify the "-truth" option to override truth operators to return "boolean" values.
use boolean -truth;
print ref("hello" eq "world"), "
";
Prints:
boolean
"-truth" can be used with the other import options.
AUTHOR
Ingy doet Net <ingy@cpan.org>
COPYRIGHT
Copyright (c) 2007, 2008, 2010, 2011. Ingy doet Net.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See http://www.perl.com/perl/misc/Artistic.html
perl v5.12.4 2011-09-12 boolean(3pm)