On Fri, 14 May 2010, Denys Vlasenko wrote:

> I did discover a lot of interesting details about shells
> while hacking on them. One is that bare "read"
> is NOT the same thing as "read REPLY"! Look at this:
>
> $ echo "  foo  b\ar  " | { read -r; echo "[$REPLY]"; }
> [  foo  b\ar  ]

$ dash -c 'echo "  foo  b\ar  " | { read -r; echo "[$REPLY]"; }'
read: 1: arg count
[]

> $ echo "  foo  b\ar  " | { read -r REPLY; echo "[$REPLY]"; }
> [foo  b\ar]

$ dash -c 'echo "  foo  b\ar  " | { read -r REPLY; echo "[$REPLY]"; }'
[foo  br]

(with a bell ringing)

> (I will add -r, thanks)

Be careful out there :)


Cheers,

-- 
Cristian
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to