02-21-2013
Quote:
Originally Posted by
xshock
Hi,
I have a shell script which uses an awk program inside. There is a variable $count inside an "if" loop which counts the no of iterations.
Now, how to print that $count value to file (or) how to export that value to a variable outside awk program. i.e, awk to shell ?
Please help.
I don't see what this has to do with sorting in awk (or nawk).
Please start a new thread to discuss this new issue and provide example code that is not working for you. (
$count in a shell script is very different from
$count in awk and nawk. You print a value explicitly in awk and nawk with a call to print or printf. There are lots of ways to print data implicitly depending on what you're doing.)
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,everyone:
I'm new to shell, and now get trouble with some script:
line=`/usr/xpg4/bin/awk '/^(*\|){2}'"$CR"'/ {print $0}' ${TIER4FILE}|grep -v
OSNAME=`sed -n ''$LINE'p' $DATALOC/os`
sort +1 /tmp/LhasaCRs2 > /tmp/LhasaCRs1
I cannot understand the "{2}" here. My mentor said it... (1 Reply)
Discussion started by: mycoy
1 Replies
2. Homework & Coursework Questions
1. The problem statement, all variables and given/known data:
I dont know what I do wrong, I am trying to create shell programming database:
I have this command first:
&& > $fname
...
echo $Name:$Surname:$Agency:$Tel:$Ref: >> $fname
then I have
echo " Name Surname Agency Tel... (2 Replies)
Discussion started by: jeht
2 Replies
3. Shell Programming and Scripting
Hi,
I usually use Access to sort data however for some reason its not working. Our systems guys and myself cannot figure it out so ive tried to use AWK to do the sorting. The file is made up of single lines in the format
... (4 Replies)
Discussion started by: eknryan
4 Replies
4. Shell Programming and Scripting
Hi,
I've a fixed width file where I need to count the number of patterns from each line between characters 1 to 15 . so can we sort them and get a count for each pattern on the file between 1 to 15 characters.
65795648617522383763831552 410828003265795648 6175223837... (5 Replies)
Discussion started by: rudoraj
5 Replies
5. Shell Programming and Scripting
I'm trying to efficiently combine the fields of two vectors (vectors b and c) into a new vector (vector d) as defined by instructions from a 3rd vector (vector a). So vector a has either a 1 or 2 in each field specifying which vector (b or c respectively) should go into that field. Vector a is... (4 Replies)
Discussion started by: LaTortuga
4 Replies
6. Shell Programming and Scripting
I want to print out the lines that have the max value in column 3. and count the occurrence of column 1; if there are more than one occurrences, line with highest column 2 value will be printed.
I have this data:
input:
AV 234 25
AV 256 76
AS 421 34
AV 124 76
BD 136 71
BD 241 76
AW... (10 Replies)
Discussion started by: aydj
10 Replies
7. Shell Programming and Scripting
input file
abc1
abc23
abc12
abc15
output
abc1
abc12
abc15
abc23 (9 Replies)
Discussion started by: yanglei_fage
9 Replies
8. Shell Programming and Scripting
Hi guys
I have a problem trying to sort output produced with the help of 'Awk'.
After "grepping" the pattern out of the file and sorting it, sort command acts a little strange:
$ grep -w -n -i "p*cmo" /bb/data/rmt4db.lrl | sort -r
32:P1096CMO 63836 344 passthru
31:P1084CMO 121335 329 passthru... (3 Replies)
Discussion started by: aoussenko
3 Replies
9. Shell Programming and Scripting
Hi,
I need help to sort string using awk. I don't want to use sed or perl as I want to add this functionality in my existing awk script
Basically I have a variable in AWK which is string with comma separated value. I want to sort that string before using that variable in further processing
for... (10 Replies)
Discussion started by: rocky.community
10 Replies
LEARN ABOUT DEBIAN
gstreamer::caps
GStreamer::Caps(3pm) User Contributed Perl Documentation GStreamer::Caps(3pm)
NAME
GStreamer::Caps - Structure describing sets of media formats
SYNOPSIS
my $empty = GStreamer::Caps::Empty -> new();
my $any = GStreamer::Caps::Any -> new();
my $structure = {
name => "urgs",
fields => [
[field_one => "Glib::String" => "urgs"],
[field_two => "Glib::Int" => 23]
]
};
my $full = GStreamer::Caps::Full -> new($structure);
my $simple = GStreamer::Caps::Simple -> new(
"audio/mpeg",
field_one => "Glib::String" => "urgs",
field_two => "Glib::Int" => 23);
DESCRIPTION
To create a GStreamer::Caps object, you call one of the following constructors:
GStreamer::Caps::Any->new
GStreamer::Caps::Empty->new
GStreamer::Caps::Full->new
GStreamer::Caps::Simple->new
HIERARCHY
Glib::Boxed
+----GStreamer::Caps
METHODS
$caps1->append ($caps2)
o $caps2 (GStreamer::Caps)
$caps->append_structure ($structure)
o $structure (GStreamer::Structure)
boolean = $caps->do_simplify
caps = GStreamer::Caps->from_string ($string)
o $string (string)
caps = $caps1->intersect ($caps2)
o $caps2 (GStreamer::Caps)
boolean = $caps1->is_always_compatible ($caps2)
o $caps2 (GStreamer::Caps)
boolean = $caps->is_any
boolean = $caps->is_empty
boolean = $caps1->is_equal ($caps2)
o $caps2 (GStreamer::Caps)
boolean = $caps1->is_equal_fixed ($caps2)
o $caps2 (GStreamer::Caps)
boolean = $caps->is_fixed
boolean = $subset->is_subset ($superset)
o $superset (GStreamer::Caps)
caps = $caps->make_writable
caps = $caps->normalize
$caps->set_simple ($field, $type, $value, ...)
o $field (string)
o $type (string)
o $value (scalar)
o ... (list)
integer = $caps->get_size
structure = $caps->get_structure ($index)
o $index (integer)
caps = $minuend->subtract ($subtrahend)
o $subtrahend (GStreamer::Caps)
string = $caps->to_string
$caps->truncate
caps = $caps1->union ($caps2)
o $caps2 (GStreamer::Caps)
SEE ALSO
GStreamer, Glib::Boxed
COPYRIGHT
Copyright (C) 2005-2011 by the gtk2-perl team.
This software is licensed under the LGPL. See GStreamer for a full notice.
perl v5.14.2 2012-03-01 GStreamer::Caps(3pm)