Sponsored Content
Top Forums Shell Programming and Scripting Script not working..."sort" not working properly.... Post 302297734 by Perderabo on Saturday 14th of March 2009 07:54:07 PM
Old 03-14-2009
Quote:
Originally Posted by Rahulpict
@Perderabo - I didn't change my input file after you gave me script.
yes you did.

Look at the output you posted before and after the time you tried my suggestion. Your largest divisor is 1083 and most divisors are just 1, 2, or 3. But when you tried my sort suggestion you suddenly have stuff like:
9.742084/395690
All a sort can do is re-arrange the order in which the lines are printed. The smallest divisor you used which my suggestion is much larger than the largest divisor you used before and after. Well, that your prerogative I guess... use any data you want. But you didn't answer my question. Regardless of the data, when you used my suggestion, the output you got was sorted correctly by field three. Why do you claim otherwise?
 

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
asciitopgm(1)                                                 General Commands Manual                                                asciitopgm(1)

NAME
asciitopgm - convert ASCII graphics into a portable graymap SYNOPSIS
asciitopgm [-d divisor] height width [asciifile] DESCRIPTION
Reads ASCII data as input. Produces a portable graymap with pixel values which are an approximation of the "brightness" of the ASCII char- acters, assuming black-on-white printing. In other words, a capital M is very dark, a period is ver light, and a space is white. Input lines which are fewer than width characters are automatically padded with spaces. The divisor argument is a floating-point number by which the output pixels are divided; the default value is 1.0. This can be used to adjust the brightness of the graymap: for example, if the image is too dim, reduce the divisor. In keeping with (I believe) Fortran line-printer conventions, input lines beginning with a + (plus) character are assumed to "overstrike" the previous line, allowing a larger range of gray values. This tool contradicts the message in the pbmtoascii manual: "Note that there is no asciitopbm tool - this transformation is one-way." BUGS
The table of ASCII-to-grey values is subject to interpretation, and, of course, depends on the typeface intended for the input. SEE ALSO
pbmtoascii(1), pgm(5) AUTHOR
Wilson H. Bent. Jr. (whb@usc.edu) 26 December 1994 asciitopgm(1)
All times are GMT -4. The time now is 06:18 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy