You are not logged in.

#1 2007-07-15 13:38:46

xqterry
Member
Registered: 2007-06-07
Posts: 3

small size file can not read correctly on other linux

Hi, I am running archlinux 0.8 on my laptop, and there is another linux runs kernel version 2.6.20 with root filesystem of debian v3.1.
I wrote a shell script which reads a small, 49 bytes, only 1 line conf file on my archlinux, it works fine.
But if I copy script & conf files to debian, the script can not read conf file with:

while read f;do; echo $f; done < conf

but `cat`,`more` commands can read it. I have to open conf file with vi on debian and do nothing but :wq rewrite it to make script working.

Both arch & debian use ext3 file system. Could anyone tell me why? thanks.

Offline

#2 2007-07-15 13:52:08

ataraxia
Member
From: Pittsburgh
Registered: 2007-05-06
Posts: 1,553

Re: small size file can not read correctly on other linux

You ought to tell us what kind of error you get...

Offline

#3 2007-07-15 13:54:46

xqterry
Member
Registered: 2007-06-07
Posts: 3

Re: small size file can not read correctly on other linux

Sorry, I don't know what the error is, but

`while read f; do; echo $f; done < conf`

returns nothing. It should output the conf file content.

Offline

#4 2007-07-15 13:57:41

ataraxia
Member
From: Pittsburgh
Registered: 2007-05-06
Posts: 1,553

Re: small size file can not read correctly on other linux

That's weird and I don't have the answer.

Offline

#5 2007-07-15 18:13:59

George_K
Member
From: Russie, Saint-Pétersbourg
Registered: 2006-09-27
Posts: 75

Re: small size file can not read correctly on other linux

I think your command is wrong: it works with zsh and doesn`t work in bash. Maybe you should remove extra ';'?

while read f;do echo $f; done < conf

Offline

Board footer

Powered by FluxBB