Don't know if this is a dummy question, but let's give it a try.
I yesterday had a problem with undefined behaviour in the sort shell command (I'm using bash), leading to different sort orders without apparent reasons. I resolved this by typing
and adding this to my .bash_profile as well.
The language is still set to english :
But now, the shell doesn't recognize special characters anymore, like accented ones (I've lots of them : although my system is in english, I'm in France so I've lots of accents in my filenames).
Even in english text, non-recognized characters do appear (for instance "man rpm" gives "<E2><80><99>" characters).
My question : is it "either-or", i.e. either correct sorting behaviour or correct character handling, or is there a way to have both behave correctly ?
I see strange results when sorting with -n options and I wander if somebody can explain it.
Input file and two results:
$ cat aa
14
-1
11
-1
0
-1
0
$ sort -u aa
-1
0 (1 Reply)
Hi,
Consider the code snippet below:
fun()
{
while read x
do
echo $x
done < somefile_that_does_not_exists
}
fun
echo I am here
Korn shell on HPUX prints the message "I am here", while the behaviour is different on AIX korn shell. We do not get the message on AIX. Any... (5 Replies)
hi
i am student and i learn computer sciences
i need to write a script that can will be execute automatically when a user logs on a computer, and will be automatically disconnect after a duration that i will determine
can somebody help me
thank (1 Reply)
hi,
I am new in the shell script, and c programming with linux. I am looking to pass the arguments in c program that should be executed by the shell script.
e.g.
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv)
{ int i;
for (i=1;i<argc; i++)
{
... (2 Replies)
I am in need to execute the Files transferring's shell script from ABAP programming language. it would be highly appreciated if you help me as quickly as possible. Thank you (28 Replies)
Hello,
I am a bit puzzled by the way my shell treats spaces in filenames.
An example will be way clearer than any explanation I can make:
$ ls test\ file\ with\ spaces
test file with spaces
$ var="test\ file\ with\ spaces"
$ echo $var
test\ file\ with\ spaces
$ ls $var
ls: cannot... (4 Replies)
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)
I have got a file BeforeSort.txt having 40 fields seperated by "|"
First field= RecordType (Value will be P or FP)
Second field= CamCode
Third field = UpdatingDate
Fourth field = ProductType
Fifth field = ActionCode (Value may be 01, 02 or 03)
Sixth field = ProductCode
and so on
My... (1 Reply)
hello
whats the difference between excuting a shell script as
a)sh myscript.sh
b). ./myscript.sh
i noticed that my shell script works fine when i run it as . ./myscript
.sh but fails when i run it as sh myscript.sh could anybody explain why.
the shell script is very simple
... (9 Replies)