Siduction Forum

Siduction Forum => Software - Support => Topic started by: clubex on 2015/12/22, 00:14:53

Title: Odd command behaviour
Post by: clubex on 2015/12/22, 00:14:53
Does anyone know why

~/cleanup$ for i in 'cat replace.txt' ; do apt-get download $i/sid; done


produces

E: Unable to locate package cat
E: Unable to locate package replace.txt
E: Couldn't find any package by glob 'replace.txt'
E: Couldn't find any package by regex 'replace.txt'

on my en_gb machine?

Yet a copy paste from this site does what it's supposed to do.
EDIT: This happens both in bash and tty.
Title: Re: Odd command behaviour
Post by: jure on 2015/12/22, 00:29:20
is there a space between  'cat replace.txt' and ";"  ?
~/cleanup$ for i in 'cat replace.txt' ; do apt-get download $i/sid; done
Title: Re: Odd command behaviour
Post by: horo on 2015/12/22, 07:40:29
try for i in $(cat replace.txt) ...
instead of the wrong backticks '...'
Ciao, Martin
Title: Re: Odd command behaviour
Post by: clubex on 2015/12/22, 09:31:24
Thanks guys
Jure:
Shouldn't make any difference IMO.

horo:
Thast worked OK! But I dont't seee why, unless there is a character set or language  problem on my machine. (I did read somewhere about some difference between the en_Us and en_GB language packs.)
Title: Re: Odd command behaviour
Post by: towo on 2015/12/22, 10:22:26
for i in 'cat foo'
wrong!


for in in `cat foo`
right


You see the difference?


That's why
for i in $(cat foo)
[/size][size=78%]is the better variant.[/size]