04-27-2011
Got that in the loop ... works great !! can you please explain how $a cmp $b works here ??
Cheers bartus
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I am trying to make a script that creates a list of all active (alive) processes sorted by size and then print this list on screen.
Could anyone help me?
Thaks a lot (7 Replies)
Discussion started by: pro
7 Replies
2. Programming
I had seen this error for the first time .....
error: initializer expression list treated as compound expression
please help.... (12 Replies)
Discussion started by: arunchaudhary19
12 Replies
3. Shell Programming and Scripting
Hi -
I am guessing this is fairly simple for someone .. but I can not quite figure it out. I need a sed command to print just parts of lines from a file.
e.g. filea.txt
4710451 : Success : MODIFY : cn=user1,dc=org,dc=uk
Message log started
Message log ended
4710452 : Success : MODIFY :... (7 Replies)
Discussion started by: sniper57
7 Replies
4. UNIX for Advanced & Expert Users
Hi
Is there any unix shell command or utility to know if the file is sorted or not?
Thanks (3 Replies)
Discussion started by: ksailesh
3 Replies
5. Shell Programming and Scripting
Hey, I found a way to print the lines which is just before a regular expression, not including the expression.
sed -n '/regexp/{n;p;}' myfile
Now I'm looking for a way to print all lines, exept the regular expression and also the line before the same regular expression.
Use code tags. (1 Reply)
Discussion started by: Livio
1 Replies
6. Shell Programming and Scripting
Hello,
I want to print a number of lines of a file after a specific expression of a line.
I have this sed command but it prints only 1 line after the expression.
How could I adapt it to print for instance 10 lines after or 15 lines after ?
sed -n '/regexp/{n;p;}'
Thx & Regs,
Rany. (5 Replies)
Discussion started by: rany1
5 Replies
7. Shell Programming and Scripting
CA_RELEASE has a value of 6. I need to check if that this is a numeric value. if not error.
source $CA_VERSION_DATA
if * ]
then
echo "CA_RELESE $CA_RELEASE is invalid"
exit -1
fi
+ source /etc/ncgl/ca_version_data
++ CA_PRODUCT_ID=samxts
++ CA_RELEASE=6
++ CA_WEEK_NO=7
++... (3 Replies)
Discussion started by: ketkee1985
3 Replies
8. UNIX for Dummies Questions & Answers
Dear All,
I am trying to sort an array of numbers to retrieve the mimimum and maximum values of numbers in that array, by printing the first and last elements of the sorted array. My code is @sorted_numbers = sort (@numbers);
print "@sorted_numbers\n";
print "$sorted_numbers,... (0 Replies)
Discussion started by: pawannoel
0 Replies
9. UNIX for Advanced & Expert Users
Hello All,
I'm trying to extract the lines between two consecutive elements of an array from a file.
My array looks like:
problem_arr=(PRS111 PRS213 PRS234)
j=0
while } ]
do
k=`expr $j + 1`
sed -n "/${problem_arr}/,/${problem_arr}/p" problemid.txt
---some operation goes... (11 Replies)
Discussion started by: InduInduIndu
11 Replies
10. Shell Programming and Scripting
hi All ,
I am having a large file with lots of modules as shown below
###############################################
module KKK
kksd
kskks
jsn;lsm
jsnlsn;
Ring
jjsjsj
kskmsm
jjs
endmodule
module llll
1kksd11
k232skks
j33sn;l55sm (6 Replies)
Discussion started by: kshitij
6 Replies
LEARN ABOUT CENTOS
devel::cover::truth_table
Devel::Cover::Truth_Table(3) User Contributed Perl Documentation Devel::Cover::Truth_Table(3)
NAME
Devel::Cover::Truth_Table - Truth tables for coverage objects.
VERSION
version 1.03
SYNOPSIS
use Devel::Cover::Truth_Table;
# $a || $b
my $or_tt = Devel::Cover::Truth_Table->new_primitive('or_3', 0, 1, 1);
# $c && $d
my $and_tt = Devel::Cover::Truth_Table->new_primitive('and_3', 1, 0, 1);
# merge contents of $and_tt into right column of $or_tt, to create
# $a || ($c && $d)
$or_tt->right_merge($and_tt);
# get a (sorted) textual representation
my @text = $or_tt->sort->text;
print "$_
" foreach @text;
__END__
A B C |exp|hit
--------------
0 0 X | 0 |---
0 1 0 | 0 |---
0 1 1 | 1 |+++
1 X X | 1 |+++
--------------
DESCRIPTION
This module provides methods for creating and merging conditional primitives ("$a && $b", "$c || $d", etc.) into more complex composite
expressions.
METHODS
new_primitive($op, @coverage)
Create a new truth table based on one of the built-in primitives, which are the subclasses of Devel::Cover::DB::Condition. $op is one of
the following:
and_3
"and" or "&&" with three conditional paths.
or_3
"or" or "||" with three conditional paths.
or_2
"or" or "||" with two conditional paths. (i.e., when the right hand side of the expression is a constant)
xor_4
"xor" with four conditional paths.
@coverage is a list booleans identifying which of the possible paths have been covered.
sort()
Sorts a truth table (in place) and returns the sorted object.
text()
Format a truth table to an array of strings for printing.
html()
Format a truth table in HTML.
error()
percentage()
Determines the proportion of possible conditions that have coverage.
right_merge($sub_table)
Merge entries from $sub_table into right column of table.
left_merge($sub_table)
Merge entries from $sub_table into left column of table.
SEE ALSO
Devel::Cover
BUGS
None that I'm aware of...
LICENSE
Copyright 2002 Michael Carman <mjcarman@mchsi.com>
This software is free. It is licensed under the same terms as Perl itself. The latest version should be available from: http://www.pjcj.net
perl v5.16.3 2013-05-20 Devel::Cover::Truth_Table(3)