How to use "read" in Busybox v1.1.1 ?

Michael Conrad mconrad at intellitree.com
Wed May 13 15:27:10 UTC 2015


On 5/13/2015 7:45 AM, Mike Yates wrote:
> On 11 May 2015 at 20:01, Bastian Bittorf <bittorf at bluebottle.com> wrote:
>> * Mike Yates <xobb at fonehelp.co.uk> [11.05.2015 18:05]:
>>> The command "read" in Busybox v1.23 functions just like in GNU bash but in the
>>> v1.1.1 in my old NAS it keeps complaining of not enough arguments.
>> what is your exact commandline?
>>
> read -p "Enter name: " $name
>
> I have found that the "$" is the issue - Busybox will only accept a
> variable name without it, while Bash accepts either, or the null
> variable.

I think you have some other error in your script giving this illusion.  
My bash behaves like busybox. As far as I know it has never been 
possible to "read $foo" and get the value placed into $foo (unless $foo=foo)

$ bash --version
GNU bash, version 4.3.33(1)-release (x86_64-unknown-linux-gnu)
...

$ x=a
$ read $x
blahblah
$ echo $x
a
$ echo $a
blahblah



More information about the busybox mailing list