Sponsored Content
Top Forums UNIX for Dummies Questions & Answers linux sort command produces strange output Post 302546388 by ajb on Thursday 11th of August 2011 06:02:43 AM
Old 08-11-2011
linux sort command produces strange output

cat a
.a
ba
.b
bb
.c
bc

sort a
.a
.b
ba
bb
bc
.c

NOTE: .a and .b appears before ba and bb, where as .c appears after bc.

In general

if the file has strings of the type .<x> and <y><x>,

then for all x <= y, .x appear before yx and
for all x>y, .x appear after yx

Is this a bug or an expected behavior? It latter is the case, then what is the explanation?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

a strange message when executing the sort command

Dear all, when I issue the command: gunzip -c file.gz |sort the command is executed normally and correctly but a message keeps appearing everytime I run the command: the message: sort: missing NEWLINE added at end of input file STDIN Does anyone know what is the meaning of this message?... (3 Replies)
Discussion started by: marwan
3 Replies

2. Linux

vgscan produces no output using file descriptors on Oracle Enterprise Linux.

I wrote a simple program which will create a child process to execute a command and the output will be redirected to the file. Please have a look at the following code -> #include <stdio.h> #include <stdlib.h> #include <sys/stat.h> #include <fcntl.h> void execute(char **argv) { ... (0 Replies)
Discussion started by: sandiworld
0 Replies

3. UNIX for Advanced & Expert Users

Sort command - strange behaviour

Hi guys, I have the following example data: A;00:00:19 B;00:01:02 C;00:00:13 D;00:00:16 E;00:02:27 F;00:00:12 G;00:00:21 H;00:00:19 I;00:00:13 J;00:13:22 I run the following sort against it, yet the output is as follows: sort -t";" +1 -nr example_data.dat A;00:00:19 (16 Replies)
Discussion started by: miwinter
16 Replies

4. UNIX for Dummies Questions & Answers

Linux Sort command

Hello! Can anybody explain in laymen terms what the (+) option in the sort command for Linux does? Please. Thanks in advance!!:D (1 Reply)
Discussion started by: itisijayare
1 Replies

5. Shell Programming and Scripting

Sort command giving wrong output

Hi all, I have a problem with sort command. i have a file which looks like this: "file1 1073 java/4 1073 java/180 1073 java/170 1073 java/176 1073 java/167 1073 java/40 1073 java/33 1073 java/136 28988 java/76 28988 java/73 28988 java/48 28988 java/26" and i want to sort... (8 Replies)
Discussion started by: usha rao
8 Replies

6. UNIX for Dummies Questions & Answers

gzip produces different output from the same input

Hi there, I'm puzzled. Compressing the same file (same name, same md5sum) at two different times will produce a different output. I mean the md5sum of the resulting .gz files are different. Does it make any sens to any of you? I'd like some explanations if you know what's going on. Thanks... (4 Replies)
Discussion started by: chebarbudo
4 Replies

7. Solaris

Getting strange output of who -r command

Hi At OK> prompt, I have run the boot -s command After system is coming on to multiuser state, when I run the " who -r" command, I get the following message # who -r run-level Oct 17 03:48 last= Means I dont see "S" after run-level keyword. Could any one... (2 Replies)
Discussion started by: amity
2 Replies

8. Shell Programming and Scripting

Need a shell script to compare two directories and produces the output

Hi, I am using solaris OS 10 and Bash shell.I need a script which will compare the two directories and produces the output. Step 1: In detail say suppoose I have machine one and have a directory dir1. Script should iterate through the directories and subdirectories inside and produce the output... (10 Replies)
Discussion started by: muraliinfy04
10 Replies

9. Homework & Coursework Questions

linux sort command

This is the question being asked: (Sort your data file by last name first, then by the first name second - save as first_last.) I am not quite sure of the type of sort I am being asked to perform. I have read the man pages of the sort command a few times, as well as searching online for possible... (10 Replies)
Discussion started by: demet8
10 Replies

10. Shell Programming and Scripting

awk runs and produces output but with error

When I run the awk below, I get an error message awk -v OFS='\t' '$(NF-1)=="Benign" || ($(NF-2) OFS $(NF-1))=="Likely Benign" {$(NF)=$(NF-2) OFS $(NF-1)} {print $0 }' input awk: cmd. line:1: (FILENAME=VUS FNR=8) fatal: attempt to access field -1 input Chr Start End Ref ... (6 Replies)
Discussion started by: cmccabe
6 Replies
AMC-EXPORT(1)						       Auto Multiple Choice						     AMC-EXPORT(1)

NAME
AMC-export - exports marks for AMC multiple choice exams. SYNOPSIS
auto-multiple-choice export --data project-data-dir --module module --fich-noms students-list.csv [--noms-encodage list-encoding] --o output-file DESCRIPTION
The AMC-export.pl command exports marks from an Auto Multiple Choice exam. --data project-data-dir gives the directory where data files are (see for example AMC-prepare(1)). --module module selects a module for export. See below for the modules included in the AMC standard distribution. --fich-noms students-list.csv sets the students list file. --noms-encodage list-encoding selects an encoding for file students-list.csv (default is utf-8). --o output-file gives the output file name. --option-out options gives an option for selected module, in the form key=value (see below for possible options for each module). To specify multiple options, use --option several times. --sort sort-type sort the students names, depending on sort-type. If sort-type is l, use line number from students list file to sort. If sort-type is m, use mark (and name if marks are equal) to sort. If sort-type is i, use student number to sort. If sort-type is n, use name to sort (or line from students list if equal). --useall all if all is 0 or empty, only students with a scaned answer sheet appears in the output. If all is 1, all students in the students list appears in the output. MODULES
OpenDocument With "--module ods", an OpenDocument (for use by OpenOffice or LibreOffice for example) is produced. The following options are recognized: nom gives a name for the exam, to be written on the beginning of the sheet. code gives an short name for the exam, to be used as a tab name. columns sets the list of columns that are to be added to each student. Default value is student.key,student.name. stats with a true value, a table will be added with statistics for all questions. statsindic with a true value, a table will be added with statistics for all indicative questions. CSV With "--module CSV", a CSV file is produced. The following options are recognized: columns sets the list of columns that are to be added to each student. Default value is student.copy,student.key,student.name. decimal sets the decimal point (default is a dot). encodage sets the encoding to use for output (default is utf-8). separateur sets the character used between colums (default is a comma). entoure sets the character used to enclose strings (default is a double quote). ticked if not empty, additional columns (with "CHECKED:" prefix) are included to give all the checked boxes on all the sheets. This can be used by an external program to retrieve all the checked boxes when marks are not sufficient. Use value 01 to get 0;0;1;1;0 if boxes 3 and 4 are checked, and value AB to get CD if boxes 3 and 4 are checked. List With "--module List", a PDF file is produced with a list of marks for all students. The following options are recognized: pagesize The page size. Default value is a4. nom gives the name of the exam, to be printed at the top of the page. ncols The number of columns. Default value is 2. decimal sets the decimal point (default is a dot). AUTHORS
Alexis Bienvenue <paamc@passoire.fr> Main author Jean Berard Translation from French Georges Khaznadar Translation from French COPYRIGHT
Copyright (C) 2008-2012 Alexis Bienvenue This document can be used according to the terms of the GNU General Public License, version 2 or later. Auto Multiple Choice 1.1.1 06/19/2012 AMC-EXPORT(1)
All times are GMT -4. The time now is 10:27 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy