Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Weird: unexpected result after piping a sort Post 302762491 by rveri on Monday 28th of January 2013 02:31:06 PM
Old 01-28-2013
sorry I misunderstood in first question.Can you put exact output, how mylisting is coming in the list of file. Or try from another directory. The output file name should not be coming in the redirection.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

sort unexpected error?

I have the following script: mysort.sh: #!/bin/ksh for i in `ls` sort -bfu $i > sort_$i wait mv sort_$i $i wait done exit 0 I get the following error: mysort.sh: syntax error at line 3 : `sort' unexpected Does anybody know what I am missing here. ... (2 Replies)
Discussion started by: radhika
2 Replies

2. Shell Programming and Scripting

unexpected pipeline result with find -exec

Hi All, I probably miss something fundamental here. I want to rename a bunch of files in subdirectories (that might contain white spaces) with names that are related. I thought following could do the job: find . -name *.sh -exec mv {} $(echo {} | sed -e 's/0/1/g') \; Now to be able to... (5 Replies)
Discussion started by: blued
5 Replies

3. Shell Programming and Scripting

Unexpected sed result.

I am in the process of writing a script to change the grub password in the grub.conf file. I thought I had it figured out, but am running into an a problem I can't put my finger on. Command I am running when I find that the grub.conf file contains "password --md5". sed... (1 Reply)
Discussion started by: viRaven
1 Replies

4. Shell Programming and Scripting

sort piping to awk array - help please

Hi I'm just learning programming and need some help. I've taken a data file which has a list of numbers eg: 3 5 32 533 13 2 And I've used sort -n and to sort and then piped it to awk to arrange into an array. #!/bin/sh sort -n data.txt | awk ' { array=$1 } (4 Replies)
Discussion started by: EL_Chemso
4 Replies

5. Shell Programming and Scripting

shell script - unexpected result

I hv a file --am executing a script which is giving me unexpected results COntents of file: f1 CMT_AP1_CONT:/opt/sybase/syboc125:150:ASE12_5::Y:UX: CMT_AP1:/opt/sybase/syboc125:150:ASE12_5::Y:UX f1.tmp CMT_AP1_CONT:/opt/sybase/syboc125:150:ASE12_5::Y:UX:... (2 Replies)
Discussion started by: rajashekar.y
2 Replies

6. UNIX for Advanced & Expert Users

Weird "sort" behavior

Hi, I'm trying to sort a text file "test": S12 S_S12 S_S1_12 S15 S_N15 S_N1_15 By "sort test", I get: S12 S15 S_N1_15 S_N15 S_S1_12 S_S12 It seems weird: Comparing Line 2 and Line 3, it must be that '-' is bigger than '1'; however, comparing Line 3 and Line 4, it seems that... (3 Replies)
Discussion started by: intermilan
3 Replies

7. Shell Programming and Scripting

How to sort grep result based on timestamp?

Hi, Trying to sort grep result based on timestamp of the filename. I have the following result and want to sort them on timestampgrep -i 'ERROR' *log*2013* s_m_xxx_xxx_xxx_xxx_xxxx.log.20130906092431:TRANSF_1_1_1> DBG_21216 Finished transformations for Source Qualifier . Total errors ... (5 Replies)
Discussion started by: bobbygsk
5 Replies

8. Emergency UNIX and Linux Support

How to take awk result out (piping to other program)?

Hi! all here is my code which is working fine no errors but I want to know how to take result and input to other program awk 'FNR==1{i++}{LC=NR} {for(k=1; k<=NF; k++) A=$k} END{for (i=1;i<=LC;i++) { for(j=1;j<=LC;j++) if(A=='$UID' && A>='$MX'+A &&... (7 Replies)
Discussion started by: Akshay Hegde
7 Replies

9. UNIX for Beginners Questions & Answers

Sort by record column, Compare with conditons and export the result

Hello, I am new to Unix and would like to seek a help, please. I have 2 files (file_1 and file_2), I need to perform the following actions. 1 ) Sort the both file by the column 26-36 (which is Invoice number) what is sort command with the column sort? 2) Compare the file_1.sorted and... (3 Replies)
Discussion started by: Usagi
3 Replies

10. UNIX for Beginners Questions & Answers

Unexpected result from awk

Hello, Giving those commands: cat > myfile 1 2 3 ^D cat myfile | awk '{ s=s+$1 ; print s}' The output is: 1 3 6 It seems like this command iterates each time on a different row so $1 is the first field of each row.. But what caused it to refer to each row ?. What I mean... (3 Replies)
Discussion started by: uniran
3 Replies
RNEWS(1)						      General Commands Manual							  RNEWS(1)

NAME
rnews - receive news from a UUCP connection SYNOPSIS
rnews [ -h host ] [ -v ] [ -U ] [ -N ] [ -S master ] [ input ] DESCRIPTION
Rnews reads messages typically queued by a UUCP newsfeed and sends them to the local InterNetNews server. The message is read from the specified input file, or standard input if no input is named. When sent over UUCP, Usenet articles are typically joined in a single batch to reduce the UUCP overhead. Batches can also be compressed, to reduce the communication time. If a message does not start with a number sign (``#'') and an exclamation point, then the entire input is taken as a single news article. If it does start with with those two characters, then the first line is read and interpreted as a batch command. If the command is ``#! rnews nnn'' where nnn is a number, then the next nnn bytes (starting with the next line) are read as a news article. If the command is ``#! cunbatch'' then the rest of input is fed to the compress(1) program with the ``-d'' flag to uncompress it, and the output of this pipe is read as rnews's input. This is for historical compatibility -- there is no program named cunbatch. A compressed batch will start with a ``#! cunbatch'' line, then contain a series of articles separated by ``#! rnews nnn'' lines. If the command is any other word, then rnews will try to execute a program with that name in the directory /usr/lib/news/rnews. The batch will be fed into the program's standard input, and the standard output will be read back as input into rnews. If rnews detects any problems with an article such as a missing header, or an unintelligible reply from the server, it will save a copy of the article in the /var/spool/news/in.coming/bad directory. OPTIONS
-S If the ``-S'' flag is used, then rnews will connect to the specified host. If the flag is not used, it will try to connect to the server by opening a Unix-domain stream connection. If that fails, it will try to open a TCP connection to the default remote server. -U If the server is not available, the message is spooled into a new file created in the /var/spool/news/in.coming directory. The ``-U'' flag may be used to send all spooled messages to the server once it becomes available again, and can be invoked regularly by cron(8). -N Normally, if unpacking the input fails it is re-spooled to /var/spool/news/in.coming for another attempt later. If the ``-N'' flag is used then no such re-spooling is done and rnews exits with status value ``9'' to indicate this. -v If the ``-v'' flag is used, it will print a notice of all errors on the standard error, naming the input file (if known) and print- ing the first few characters of the input. Errors are always logged through syslog(3). -h If the ``-h'' flag is given, or failing that, the enviroment variable UU_MACHINE is set, then rnews will log the Message-ID, and host, for each article offered to the server via syslog(3). Logging will only be done if the value is not an empty string. BUGS
Rnews cannot process articles that have embedded 's in them. HISTORY
Written by Rich $alz <rsalz@uunet.uu.net> for InterNetNews. This is revision 1.23, dated 1996/11/08. SEE ALSO
innd(8). RNEWS(1)
All times are GMT -4. The time now is 09:20 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy