Bug 3973 - The internal command "read" is not working properly on arm processor
Summary: The internal command "read" is not working properly on arm processor
Status: RESOLVED INVALID
Alias: None
Product: Busybox
Classification: Unclassified
Component: Standard Compliance (show other bugs)
Version: 1.18.x
Hardware: Other Linux
: P5 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-13 07:08 UTC by Evgheni
Modified: 2011-07-14 06:54 UTC (History)
2 users (show)

See Also:
Host: linux
Target: arm
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Evgheni 2011-07-13 07:08:59 UTC
The internal command "read" is not working properly. 

How to reproduce:  please use follow example: 

#!/bin/ash
read -r -s -p "please enter password: " "var1"
read -r -s -p "please retype password: " "var2"
if [ "$var1" = "$var2" ] ; then
   echo user:$var1 | /usr/sbin/chpasswd -m
else echo "Passwords don't match"
fi

On the standart linux system with busybox:
#!/bin/sh

read -r -s -p "please enter password: " "var1"
+ read -r -s -p 'please enter password: ' var1
please enter password: 
echo "var1 = $var1"
+ echo 'var1 = 123'
var1 = 123
read -r -s -p "please retype password: " "var2"
+ read -r -s -p 'please retype password: ' var2
please retype password: echo "var2 = $var2"
+ echo 'var2 = 123'
var2 = 123

if [ "$var1" = "$var2" ] ; then
        echo user:$var1 | /usr/sbin/chpasswd -m
else echo "Passwords don't match"
fi
+ '[' 123 = 123 ']'
+ echo user:123
+ /usr/sbin/chpasswd -m

On linux system with arm processor:

read -r -s -p "please enter password: " "var1"
+ read -r -s -p please enter password:  var1
please enter password: read -r -s -p "please retype password: " "var2"
+ read -r -s -p please retype password:  var2
please retype password: if [ "$var1" = "$var2" ] ; then
   echo user:$var1 | /usr/sbin/chpasswd -m
else echo "Passwords don't match"
fi
+ [  = 123 ]
+ echo Passwords don't match
Passwords don't match

Conclusion: it's looks that "read" command missed first argument and uses it as argument of next "read" command. I have understood that may be it's dependent from different properties of my system and conditions of building busybox, but I have not found any records for "read" command in the menuconfig as was in previous  versions.
This bug has been found in versions 1.10.2 and 1.11.1 but only on ARM processor.
Comment 1 Evgheni 2011-07-14 06:54:28 UTC
I'm sorry, I have found an error in my console command line. 

This bug is not actual more.

Closing it.