Odd command behaviour

Started by clubex, 2015/12/22, 00:14:53

Previous topic - Next topic

clubex

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.

jure

is there a space between  'cat replace.txt' and ";"  ?
~/cleanup$ for i in 'cat replace.txt' ; do apt-get download $i/sid; done
Gruss Juergen

horo

#2
try for i in $(cat replace.txt) ...
instead of the wrong backticks '...'
Ciao, Martin
omnia vincit pecunia :(

clubex

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.)

towo

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]
Ich gehe nicht zum Karneval, ich verleihe nur manchmal mein Gesicht.