Bug 604474
Summary: | bash builtin echo -E option hides and interprets "-E", "-n" and "-e" strings when they are first. | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Paul Moore <pmoore> |
Component: | bash | Assignee: | Roman Rakus <rrakus> |
Status: | CLOSED NOTABUG | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | medium | Docs Contact: | |
Priority: | low | ||
Version: | 12 | CC: | pmoore, rrakus, tsmetana |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2010-06-16 14:31:17 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Paul Moore
2010-06-16 01:44:00 UTC
Using the bash builtin echo I get what are you expecting. Using the echo from coreutils I get your actual result. Which echo are you using? What is `type echo' returning? The problem of the "-E", "-n" "-e" characters not showing is the same for both the bash built-in "echo" and the coreutils "/bin/echo" on both Red Hat Enterprise Linux Server 5 and Fedora 12. Red Hat Enterprise Linux 5 is interpreting the "-e" for both the bash built-in "echo" and the coreutils "/bin/echo", while Fedora 12 is not interpreting the "-e" for both the bash built-in "echo" and the coreutils "/bin/echo". ==============Results=============== [root@hmserver ~]# cat /etc/redhat-release ; rpm -qf $(which echo) $(which bash) Red Hat Enterprise Linux Server release 5 (Tikanga) coreutils-5.97-12.1.el5 bash-3.1-16.1 [root@hmserver ~]# which echo; which bash; echo -E '-E' '-n' '-e' '-hu\160' /bin/echo /bin/bash -hup[root@hmserver ~]# [root@hmserver ~]# mv /bin/echo{,_}; echo -E '-E' '-n' '-e' '-hu\160' -hup[root@hmserver ~]# mv /bin/echo{_,} [root@hmserver ~]# ------------- [root@widebit ~]# cat /etc/redhat-release ; rpm -qf $(which echo) $(which bash) Fedora release 12 (Constantine) coreutils-7.6-11.fc12.x86_64 bash-4.0.35-3.fc12.x86_64 [root@widebit ~]# which echo; which bash; echo -E '-E' '-n' '-e' '-hu\160' /bin/echo /bin/bash -hu\160[root@widebit ~]# mv /bin/echo{,_}; echo -E '-E' '-n' '-e' '-hu\160' -hu\160[root@widebit ~]# mv /bin/echo{_,} ------------- Sorry, I didn't properly read your request to use 'type echo'. - Repeated below with the same results. I consider the primary problem to be that the "-E", "-n" "-e" characters are not showing when they are first on the line. This is the same for both the bash built-in "echo" and the coreutils "/bin/echo" on both Red Hat Enterprise Linux Server 5 and Fedora 12. Red Hat Enterprise Linux 5 is interpreting the "-e" for both the bash built-in "echo" and the coreutils "/bin/echo", while Fedora 12 is not interpreting the "-e" for both the bash built-in "echo" and the coreutils "/bin/echo". [root@hmserver ~]# cat /etc/redhat-release ; rpm -qf $(which echo) $(which bash) Red Hat Enterprise Linux Server release 5 (Tikanga) coreutils-5.97-12.1.el5 bash-3.1-16.1 [root@hmserver ~]# which echo; which bash; /bin/echo -E '-E' '-n' '-e' '-hu\160' /bin/echo /bin/bash -hup[root@hmserver ~]# type echo; echo -E '-E' '-n' '-e' '-hu\160' echo is a shell builtin -hup[root@hmserver ~]# ----------------- [root@widebitfixed ~]# cat /etc/redhat-release ; rpm -qf $(which echo) $(which bash) Fedora release 12 (Constantine) coreutils-7.6-11.fc12.x86_64 bash-4.0.35-3.fc12.x86_64 [root@widebitfixed ~]# which echo; which bash; /bin/echo -E '-E' '-n' '-e' '-hu\160' /bin/echo /bin/bash -hup[root@widebitfixed ~]# type echo; echo -E '-E' '-n' '-e' '-hu\160' echo is a shell builtin -hu\160[root@widebitfixed ~]# This seems to also be a coreutils problem in at least coreutils-7.6-11.fc12.x86_64 and coreutils-5.97-12.1.el5. (In reply to comment #3) > Sorry, I didn't properly read your request to use 'type echo'. - Repeated below > with the same results. > Please note the usage of `type' builtin. It is very usefull. > I consider the primary problem to be that the "-E", "-n" "-e" characters are > not showing when they are first on the line. This is the same for both > the bash built-in "echo" and the coreutils "/bin/echo" on both Red Hat > Enterprise Linux Server 5 and Fedora 12. > > Red Hat Enterprise Linux 5 is interpreting the "-e" for both the bash built-in > "echo" and the coreutils "/bin/echo", while Fedora 12 is not interpreting the > "-e" for both the bash built-in "echo" and the coreutils "/bin/echo". > > [root@hmserver ~]# cat /etc/redhat-release ; rpm -qf $(which echo) $(which > bash) > Red Hat Enterprise Linux Server release 5 (Tikanga) > coreutils-5.97-12.1.el5 > bash-3.1-16.1 > [root@hmserver ~]# which echo; which bash; /bin/echo -E '-E' '-n' '-e' > '-hu\160' > /bin/echo > /bin/bash > -hup[root@hmserver ~]# type echo; echo -E '-E' '-n' '-e' '-hu\160' > echo is a shell builtin > -hup[root@hmserver ~]# > > > ----------------- > > > [root@widebitfixed ~]# cat /etc/redhat-release ; rpm -qf $(which echo) $(which > bash) > Fedora release 12 (Constantine) > coreutils-7.6-11.fc12.x86_64 > bash-4.0.35-3.fc12.x86_64 > [root@widebitfixed ~]# which echo; which bash; /bin/echo -E '-E' '-n' '-e' > '-hu\160' > /bin/echo > /bin/bash > -hup[root@widebitfixed ~]# type echo; echo -E '-E' '-n' '-e' '-hu\160' > echo is a shell builtin > -hu\160[root@widebitfixed ~]# There is a problem elsewhere. On RHEL5 bash's echo interprets the escape sequence in different way than F12 bash. Just try following example: echo -e '\123'; echo -e '\0123' on RHEL5 and on F12. On RHEL5 there's no need for \0nnn format like on F12. This is the same like in coreutils' echo. Regarding multiple -E -e arguments - the last one is used. |