[Bug 880120] Re: read -r does not protect backslashes
Jilles Tjoelker
880120 at bugs.launchpad.net
Sat Oct 22 23:10:29 UTC 2011
*** This bug is a duplicate of bug 259671 ***
https://bugs.launchpad.net/bugs/259671
The backslash escape sequences are being processed by "echo", not
"read". You can avoid this inconsistency by doing something like
printf "%s\n" '000\n999' | dash -c ' read -r f ; printf "%s\n" "$f" '
** This bug has been marked a duplicate of bug 259671
dash: echo builtin interprets backslash escape sequences
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to dash in Ubuntu.
https://bugs.launchpad.net/bugs/880120
Title:
read -r does not protect backslashes
Status in “dash” package in Ubuntu:
New
Bug description:
Both natty and oneiric dash fail to protect backslashes when using
"read -r".
natty: dash 0.5.5.1-7.2ubuntu1
oneiric: dash 0.5.5.1-7.4ubuntu1
Example bug:
$ echo '000\n999' | dash -c ' read -r f ; echo "$f" '
000
999
Other shells do it correctly:
$ echo '000\n999' | bash -c ' read -r f ; echo "$f" '
000\n999
$ echo '000\n999' | static-sh -c ' read -r f ; echo "$f" '
000\n999
This means you can't use "read" to read arbitrary lines of text.
ProblemType: Bug
DistroRelease: Ubuntu 11.04
Package: dash 0.5.5.1-7.2ubuntu1
ProcVersionSignature: Ubuntu 2.6.38-12.51-generic 2.6.38.8
Uname: Linux 2.6.38-12-generic x86_64
Architecture: amd64
Date: Sat Oct 22 18:28:32 2011
InstallationMedia: Ubuntu 11.04 "Natty Narwhal" - Release amd64 (20110427.1)
SourcePackage: dash
UpgradeStatus: No upgrade log present (probably fresh install)
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/dash/+bug/880120/+subscriptions
More information about the foundations-bugs
mailing list