This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

weird behaviour of shell commands


Hi,

When executing chev.sh (a bad performance script that allows me to reverse lines of a text file), the result (chev2.txt) should have a size of 1565 bytes, that is the same size as chev.txt.
The problem is it won't. Weirder, the result gives random sizes everytime (sometimes 1563, 1559 etc.).
I don't understand what happens at all.
Files : versions*.jpg : versions of all installed cygwin packages
chev.sh : the shell script that gives the wrong result
chev.txt : the file text needed for chev.sh to work


Regards,

C.Rutkowski

JPEG image

JPEG image

JPEG image

0
0
0
4,65
0
3,45
0
0
0
0
2,40
3,15
2,25
0
0
0
0
0
0
0
0
0
2,85
2,25
0
2,85
3,90
4,65
0
3,15
4,50
0
3,60
0
0
0
0
4,65
2,40
0
0
0
0
0
2,25
0
0
0
0
3,15
3,00
0
2,10
0
0
0
4,05
0
3,45
0
6,15
2,55
3,30
2,25
4,95
4,05
0
0
0
0
0
0
0
0
0
0
3,45
3,45
5,10
0
0
0
0
0
3,45
0
0
0
0
0
0
5,25
0
12,75
0
0
0
0
4,05
2,55
2,40
0
0
3,60
0
0
0
0
1,80
0
4,20
0
0
4,80
0
2,85
3,00
0
0
2,70
0
0
6,60
0
2,70
0
6,15
0
0
0
2,25
2,55
0
2,10
2,40
3,60
0
0
0
0
0
6,75
0
1,80
0
0
4,05
0
0
0
0
0
0
2,10
0
0
3,60
0
2,70
3,90
0
0
0
0
2,85
0
0
3,15
2,10
0
2,55
2,55
0
0
2,10
0
3,00
0
0
0
2,25
3,00
5,70
0
0
0
0
0
3,15
0
0
2,40
2,40
0
0
4,20
3,60
4,05
6,75
5,25
0
0
0
3,45
0
0
0
0
0
1,95
0
2,55
3,30
0
0
0
3,15
4,20
0
0
2,40
0
0
0
0
0
0
0
0
2,55
0
0
0
0
3,75
0
4,05
0
0
2,70
4,50
0
0
0
0
0
0
3,00
0
2,40
0
0
4,05
0
0
0
0
3,00
0
3,45
0
3,60
0
0
3,60
0
0
2,70
0
5,70
0
0
0
0
0
0
0
0
4,05
0
2,70
0
0
0
2,85
0
0
2,85
2,40
0
3,30
0
0
3,60
3,60
4,80
0
2,25
2,25
0
1,80
3,15
2,40
2,40
2,10
2,40
3,15
5,10
0
3,00
2,70
2,55
0
0
2,40
0
2,10
2,10
3,15
2,25
3,75
3,15
5,10
0
2,70
0
0
0
0
0
0
2,25
0
0
0
0
0
0
3,15
0
3,75
0
3,75
0
0
4,05
0
3,60
0
4,65
6,30
0
0
1,95
0
2,70
2,70
0
2,25
2,70
2,70
0
0
1,95
0
0
0
2,85
0
0
0
0
2,70
4,65
0
3,45
0
2,10
11,40
0
0
0
3,45
0
3,75
0
3,15
2,85
2,70
3,15
0
0
3,75
0
1,80
0
2,10
3,15
2,55
0
4,05
0
2,10
0
2,10
0
0
0
0
3,45
2,40
2,55
2,40
1,95
2,70
0
0
3,15
0
0
2,40
0
2,85
0
0
3,90
0
0
0
0
2,40
3,15
3,45
0
3,30
2,70
0
2,55
0
2,25
2,85
2,85
0
0
0
3,75
0
3,90
0
0
6,00
0
0
2,55
2,55
0
0
4,95
2,55
4,65
2,55
2,85
0
2,40
0
0
0
0
1,95
11,55
0
0
7,80
4,50
2,40
0
0
0
3,90
0
4,20
#!/usr/bin/ksh

if [ -f chev2.txt ]
then
 > chev2.txt
else
 touch chev2.txt
fi

i=1
while true
do
 tail -$i chev.txt|head -1 >> chev2.txt
 let i=i+1
 if [ $i -eq 482 ]
 then
  break
 fi
done 

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]