[Bug 259671] Re: shell script parsing of strings when there is a square bracket. Missing backslashes

2010-04-24 Thread Nonconventionally Creative
There is a much simpler test: does 
echo '\\'
print one backslash or 2?

The man page says:
   Single Quotes
 Enclosing characters in single quotes preserves the literal meaning of all 
the characters (except sin‐
 gle quotes, making it impossible to put single-quotes in a single-quoted 
string).

This bug should be SEVERE because it makes it practically impossible to
write portable shell scripts.

** Description changed:

- Backslashes are cobbled up if a string contains an open square bracket.
- 
- If you run the shell script:
- 
- #!/bin/sh
- 
- BACKSLASH='\u'
- SQUARE='\u[]'
- echo $BACKSLASH
- echo $SQUARE
- 
- on ubuntu feisty 2.6.20-16, mac os x and solaris 10 the output is:
- 
- \u
- \u[]
- 
- but after upgrading to hardy 2.6.24-19 the output is:
- 
- \u
- u[]
- 
- It seems to be the parsing of the string. This also happens parsing
- string parameters on the command line.
- 
- 
- /bin/sh is part of the bash package:
- 
- dpkg -L bash
- ...
- /bin/sh
- ...
+ In dash, backslashes are parsed within single quotes, contradicting the man 
page, as well as the behavior of other common /bin/sh implementations.
+ (Does POSIX mention anything?)
+ The following should print 2 backslashes:
+ echo '\\'

** Summary changed:

- shell script parsing of strings when there is a square bracket. Missing 
backslashes
+ dash parses backslashes in single quotes

** Also affects: dash (Debian)
   Importance: Undecided
   Status: New

-- 
dash parses backslashes in single quotes
https://bugs.launchpad.net/bugs/259671
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 259671] Re: shell script parsing of strings when there is a square bracket. Missing backslashes

2010-01-24 Thread Yann Leprince
** Changed in: dash (Ubuntu)
   Status: New = Confirmed

-- 
shell script parsing of strings when there is a square bracket. Missing 
backslashes
https://bugs.launchpad.net/bugs/259671
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 259671] Re: shell script parsing of strings when there is a square bracket. Missing backslashes

2010-01-06 Thread Yann Leprince
** Changed in: bash
   Status: New = Invalid

-- 
shell script parsing of strings when there is a square bracket. Missing 
backslashes
https://bugs.launchpad.net/bugs/259671
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 259671] Re: shell script parsing of strings when there is a square bracket. Missing backslashes

2010-01-06 Thread Yann Leprince
it appears that this is a bug in dash and not bash

** Package changed: bash (Ubuntu) = dash (Ubuntu)

-- 
shell script parsing of strings when there is a square bracket. Missing 
backslashes
https://bugs.launchpad.net/bugs/259671
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 259671] Re: shell script parsing of strings when there is a square bracket. Missing backslashes

2009-12-22 Thread Edward Crichton
Hi,

ls -l /bin/sh

/bin/sh - dash

Aah. It's plugged into dash (as is the feisty version which is working).

-- 
shell script parsing of strings when there is a square bracket. Missing 
backslashes
https://bugs.launchpad.net/bugs/259671
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 259671] Re: shell script parsing of strings when there is a square bracket. Missing backslashes

2009-12-17 Thread Yann Leprince
Thank you for taking the time to report.
When I run your test script with bash (under karmic), I get the backslash as it 
should be. However when I run it with dash (the default /bin/sh since edgy, 
6.10) the backslash does not get displayed.
Please run 'ls -l /bin/sh' so that we can decide if this is really a bash bug 
(dpkg -L containing /bin/sh does not mean that your /bin/sh is actually bash) 
or a dash bug.

-- 
shell script parsing of strings when there is a square bracket. Missing 
backslashes
https://bugs.launchpad.net/bugs/259671
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 259671] Re: shell script parsing of strings when there is a square bracket. Missing backslashes

2008-08-20 Thread Edward Crichton
** Summary changed:

- shell script parsing words with square brackets in quotes
+ shell script parsing of strings when there is a square bracket. Missing 
backslashes

** Tags added: 2.6.24-19 hardy script

-- 
shell script parsing of strings when there is a square bracket. Missing 
backslashes
https://bugs.launchpad.net/bugs/259671
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 259671] Re: shell script parsing of strings when there is a square bracket. Missing backslashes

2008-08-20 Thread Edward Crichton
** Also affects: bash
   Importance: Undecided
   Status: New

-- 
shell script parsing of strings when there is a square bracket. Missing 
backslashes
https://bugs.launchpad.net/bugs/259671
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 259671] Re: shell script parsing of strings when there is a square bracket. Missing backslashes

2008-08-20 Thread Edward Crichton
** Description changed:

  Backslashes are cobbled up if a string contains an open square bracket.
  
  If you run the shell script:
  
  #!/bin/sh
  
  BACKSLASH='\u'
  SQUARE='\u[]'
  echo $BACKSLASH
  echo $SQUARE
  
  on ubuntu feisty 2.6.20-16, mac os x and solaris 10 the output is:
  
  \u
  \u[]
  
  but after upgrading to hardy 2.6.24-19 the output is:
  
  \u
  u[]
  
  It seems to be the parsing of the string. This also happens parsing
  string parameters on the command line.
+ 
+ 
+ /bin/sh is part of the bash package:
+ 
+ dpkg -L bash
+ ...
+ /bin/sh
+ ...

-- 
shell script parsing of strings when there is a square bracket. Missing 
backslashes
https://bugs.launchpad.net/bugs/259671
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 259671] Re: shell script parsing of strings when there is a square bracket. Missing backslashes

2008-08-20 Thread Edward Crichton
** Changed in: bash (Ubuntu)
Sourcepackagename: None = bash

-- 
shell script parsing of strings when there is a square bracket. Missing 
backslashes
https://bugs.launchpad.net/bugs/259671
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs