Sponsored Content
Top Forums Shell Programming and Scripting Script not working..."sort" not working properly.... Post 302297736 by Rahulpict on Saturday 14th of March 2009 08:31:27 PM
Old 03-14-2009
Perderabo,
I haven't changed any input.
Why I should do that? Rather I know you guys r helpful why I should delay my desired task ?

Also, as I said I have already uploaded the test input file....why dont you test the below 2 commands and see the difference by yourself?
I again run these 2 commands and still the same.....

Please use my test input and try at your end.....If your saying I changed the file Smilie ......you should see the difference by urself.....

And yeah, I completely agree with your statement...the divisors are getting different....but why? again thats my question to you expert guys....

cat 12.txt | awk '{ printf "%s/%s = %3.3f\n", $11, $5, $11/$5}' | sort -r -k3 | more
9.396545/1 = 9.397
9.039183/1 = 9.039
76.712522/10 = 7.671
6.857941/1 = 6.858
18.470404/3 = 6.157
4.516811/1 = 4.517
4.214784/1 = 4.215
4.043929/1 = 4.044
3.868609/1 = 3.869
3.442802/1 = 3.443
3.198656/1 = 3.199
41.095447/2 = 20.548
2.967361/1 = 2.967
11.660539/4 = 2.915
2.599642/1 = 2.600
7.414902/3 = 2.472
2.375463/1 = 2.375
4.402904/2 = 2.201
2.123307/1 = 2.123
47.139053/3 = 15.713
7.567567/4 = 1.892
1845.985563/1083 = 1.705
5.069130/3 = 1.690
.

cat 12.txt | awk '{ printf "%s/%s = %3.3f\n", $11, $5, $11/$5}' | sort -r -k3,3n | more

9.742084/395690 = 0.000
9.510659/75186 = 0.000
9.194549/39095 = 0.000
8.146552/39095 = 0.000
8.008833/16050 = 0.000
735.600018/1760004 = 0.000
7.364725/28144 = 0.000
65.096662/842315 = 0.000
6.923107/37595 = 0.000
6.922309/127260 = 0.000
6.210832/27525 = 0.000
6.061399/82765 = 0.000
53.091542/833311 = 0.000
5.345867/53453 = 0.000
5.098626/49097 = 0.000
48.261439/135377 = 0.000
46.527917/791108 = 0.000
4.794862/9664 = 0.000
4.644286/65200 = 0.000
4.552522/11571 = 0.000
4.508161/57871 = 0.000
4.039346/87768 = 0.000
4.023613/48196 = 0.000

.
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

pf not working properly even with only "pass in all" and "pass out all" rules

i have two rules in my pf.conf file, "pass in all" and "pass out all" i was having issues with getting pf working to begin with, so i went with starting from nothing and working on up. i have an ultrasparc ultra1 200e, with an added 4-port fast ethernet sbus card, running "3.4 GENERIC#85... (4 Replies)
Discussion started by: xyyz
4 Replies

2. Shell Programming and Scripting

script not working after "tail -f"

Hi Everyone , I am facing a strange problem i have made the follwing script to watch a appending log file (abc.log) but its not moving after the line tail -f , any suggestions ===================================== #!/bin/bash while true do tail -f abc.log | grep "exceptions" echo hi... (12 Replies)
Discussion started by: xander
12 Replies

3. Shell Programming and Scripting

"sed" command is not working in shell script

Hi All, I am not much strong in shell scripting... I am using sed command in my script to find and replace a string....... This is how script looks : ############# #!/usr/bin/ksh CONFIG_FILE=iom_test.txt FIND=`echo "NIS_FTP_SERVER1=123.456.iom.com"` REPLACE=`echo... (2 Replies)
Discussion started by: askumarece
2 Replies

4. Shell Programming and Scripting

"Print" not working in script

Hello everybody, I've gotten a script together that is designed to open a .bin file and read it 32 bits at a time and then add it to the checksum. However, the only issue that I have is that it will not print anything at the end. Can anyone help me? Also, is the & symbol used for restraining... (2 Replies)
Discussion started by: TeamUSA
2 Replies

5. Shell Programming and Scripting

Script that "should work" it's not working.

Hi, this is my script: #!/bin/bash trabajo=$1 numero=`jobs | grep -n $trabajo | cut -d':' -f1` echo $trabajo echo $numero kill %$numero wait For some reason, numero=`jobs | grep -n $trabajo | cut -d':' -f1` that line wont save in numero the number I am looking for BUT if I write it... (7 Replies)
Discussion started by: lamachejo
7 Replies

6. Shell Programming and Scripting

"find . -printf" without prepended "." path? Getting path to current working directory?

If I enter (simplified): find . -printf "%p\n" then all files in the output are prepended by a "." like ./local/share/test23.log How can achieve that a.) the leading "./" is omitted and/or b.) the full path to the current directory is inserted (enclosed by brackets and a blank)... (1 Reply)
Discussion started by: pstein
1 Replies

7. Shell Programming and Scripting

Why is sort not working properly here ?

Platform: RHEL 5.4 In the below text file I have strings like following. $ cat /tmp/mytextfile.txt DISK1 DISK10 DISK101 DISK102 DISK103 DISK104 DISK105 DISK106 DISK107 DISK108 DISK109 DISK110 DISK111 DISK112 DISK113 DISK114 (8 Replies)
Discussion started by: kraljic
8 Replies

8. Shell Programming and Scripting

"if" Loop not working when executing script using cron

I am facing this weird issue where the script is working fine from the command line but when I am executing it from cron though it is working fine but the "if" loop is processing else part though I know that the if part of the logic is true and ideally the loop should execute the if portion. ... (3 Replies)
Discussion started by: sk2code
3 Replies

9. UNIX for Beginners Questions & Answers

Automate "touch" bash script not working.

#!/bin/bash -i SAVEIFS=$IFS IFS=$"\n\b" picc=$* if ; then echo $TDATE if ; then touch dummy touch -t "tdate" dummy touch -r "dummy" "$picc" else echo -e "No mod date value to apply. If there is one in your shell,\ninvoke \eStarted asking advice on this (on Linuxquestions.org).... (9 Replies)
Discussion started by: iamwrong
9 Replies

10. UNIX for Beginners Questions & Answers

"SQLPLUS -S " is not working in one environment where same code is working in another

"SQLPLUS -S " is not working in one environment where same code is working in another getting below error =================================== SQL*Plus: Release 11.2.0.3.0 Production Copyright (c) 1982, 2011, Oracle. All rights reserved. Use SQL*Plus to execute SQL, PL/SQL and SQL*Plus... (1 Reply)
Discussion started by: yogendra.barode
1 Replies
pppstats(1M)						  System Administration Commands					      pppstats(1M)

NAME
pppstats - print PPP statistics SYNOPSIS
pppstats [-a] [-v] [-r] [-z] [-c <count>] [-w <secs>] [interface] DESCRIPTION
The pppstats utility reports PPP-related statistics at regular intervals for the specified PPP interface. If the interface is unspecified, pppstats defaults to sppp0. The display is split horizontally into input and output sections containing columns of statistics describing the properties and volume of packets received and transmitted by the interface. OPTIONS
The pppstats options are: -a Display absolute values rather than deltas. With this option, all reports show statistics for the time elapsed since the link was initiated. Without this option, the second and subsequent reports show statistics for the time since the last report. -c count Repeat the display count times. If this option is not specified, the default repeat count is 1 if the -w option is not speci- fied, otherwise infinity. -r Display additional statistics summarizing the compression ratio achieved by the packet compression algorithm in use. -v Display additional statistics relating to the performance of the Van Jacobson TCP header compression algorithm. -w wait Pause wait seconds between each display. If this option is not specified, the default interval is five seconds. -z Instead of the standard display, show statistics indicating the performance of the packet compression algorithm in use. EXTENDED DESCRIPTION
The following fields are printed on the input side when the -z option is not used: IN Total number of bytes received by this interface. PACK Total number of packets received by this interface. VJCOMP Number of header-compressed TCP packets received by this interface. VJUNC Number of header-uncompressed TCP packets received by this interface. Not reported when the -r option is specified. VJERR Number of corrupted or bogus header-compressed TCP packets received by this interface. Not reported when the -r option is speci- fied. VJTOSS Number of VJ header-compressed TCP packets dropped on reception by this interface because of preceding errors. Only reported when the -v option is specified. NON-VJ Total number of non-TCP packets received by this interface. Only reported when the -v option is specified. RATIO Compression ratio achieved for received packets by the packet compression scheme in use, defined as the uncompressed size divided by the compressed size. Only reported when the -r option is specified. UBYTE Total number of bytes received, after decompression of compressed packets. Only reported when the -r option is specified. The following fields are printed on the output side: OUT Total number of bytes transmitted from this interface. PACK Total number of packets transmitted from this interface. VJCOMP Number of TCP packets transmitted from this interface with VJ-compressed TCP headers. VJUNC Number of TCP packets transmitted from this interface with VJ-uncompressed TCP headers. Not reported when the -r option is speci- fied. NON-VJ Total number of non-TCP packets transmitted from this interface. Not reported when the -r option is specified. VJSRCH Number of searches for the cached header entry for a VJ header compressed TCP packet. Only reported when the -v option is speci- fied. VJMISS Number of failed searches for the cached header entry for a VJ header compressed TCP packet. Only reported when the -v option is specified. RATIO Compression ratio achieved for transmitted packets by the packet compression scheme in use, defined as the size before compres- sion divided by the compressed size. Only reported when the -r option is specified. UBYTE Total number of bytes to be transmitted before packet compression is applied. Only reported when the -r option is specified. When the -z option is specified, pppstats displays the following fields relating to the packet compression algorithm currently in use. If packet compression is not in use, these fields display zeroes. The fields displayed on the input side are: COMPRESSED BYTE Number of bytes of compressed packets received. COMPRESSED PACK Number of compressed packets received. INCOMPRESSIBLE BYTE Number of bytes of incompressible packets (that is, those which were transmitted in uncompressed form) received. INCOMPRESSIBLE PACK Number of incompressible packets received. COMP RATIO Recent compression ratio for incoming packets, defined as the uncompressed size divided by the compressed size (including both compressible and incompressible packets). The fields displayed on the output side are: COMPRESSED BYTE Number of bytes of compressed packets transmitted. COMPRESSED PACK Number of compressed packets transmitted. INCOMPRESSIBLE BYTE Number of bytes of incompressible packets received; that is, those that were transmitted by the peer in uncompressed form. INCOMPRESSIBLE PACK Number of incompressible packets transmitted. COMP RATIO Recent compression ratio for outgoing packets. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWpppdu | +-----------------------------+-----------------------------+ |Interface Stability |Evolving | +-----------------------------+-----------------------------+ SEE ALSO
pppd(1M), attributes(5) SunOS 5.11 4 May 2001 pppstats(1M)
All times are GMT -4. The time now is 09:27 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy