[BusyBox 0001555]: ash shell functionality lack

bugs at busybox.net bugs at busybox.net
Wed Feb 13 15:52:14 UTC 2008


The following issue has been CLOSED 
====================================================================== 
http://busybox.net/bugs/view.php?id=1555 
====================================================================== 
Reported By:                alexsv
Assigned To:                BusyBox
====================================================================== 
Project:                    BusyBox
Issue ID:                   1555
Category:                   Standards Compliance
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     closed
Resolution:                 open
Fixed in Version:           
====================================================================== 
Date Submitted:             10-24-2007 14:55 PDT
Last Modified:              02-13-2008 07:52 PST
====================================================================== 
Summary:                    ash shell functionality lack
Description: 
ash shell from busybox 1.7.2 does not support the following constructions:
CR=$'\r'

for example the following script
----cut----
#!/bin/sh
CR=$'\r'
echo $CR
----cut----
will produce string "$\r" on display 
that's violation of standard (citation from man page
http://www.gnu.org/software/bash/manual/bashref.html):
==========================
 3.1.2.4 ANSI-C Quoting

Words of the form $'string' are treated specially. The word expands to
string, with backslash-escaped characters replaced as specified by the
ANSI C standard. Backslash escape sequences, if present, are decoded as
follows:

\a
    alert (bell) 
\b
    backspace 
\e
    an escape character (not ANSI C) 
\f
    form feed 
\n
    newline 
\r
    carriage return 
\t
    horizontal tab 
\v
    vertical tab 
\\
    backslash 
\'
    single quote 
\nnn
    the eight-bit character whose value is the octal value nnn (one to
three digits) 
\xHH
    the eight-bit character whose value is the hexadecimal value HH (one
or two hex digits) 
\cx
    a control-x character 

The expanded result is single-quoted, as if the dollar sign had not been
present. 
==========================
====================================================================== 

---------------------------------------------------------------------- 
 pipatron - 11-04-07 17:38  
---------------------------------------------------------------------- 
This sounds like a bashism. The relevant documentation for shell standards
should be this:

http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html 

---------------------------------------------------------------------- 
 vda - 02-13-08 07:52  
---------------------------------------------------------------------- 
Not a bug. Although I'd be happy to receive a patch which adds this (and
other) nice bashisms, with CONFIG_ASH_BASHISMS :) 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
10-24-07 14:55  alexsv         New Issue                                    
10-24-07 14:55  alexsv         Status                   new => assigned     
10-24-07 14:55  alexsv         Assigned To               => BusyBox         
11-04-07 17:38  pipatron       Note Added: 0002889                          
02-13-08 07:52  vda            Status                   assigned => closed  
02-13-08 07:52  vda            Note Added: 0004424                          
======================================================================




More information about the busybox-cvs mailing list