[BusyBox 0002924]: ash does not parse "${varname:begin:end}" for substring creation/checking

bugs at busybox.net bugs at busybox.net
Mon Apr 14 22:58:47 UTC 2008


The following issue has been CLOSED 
====================================================================== 
http://busybox.net/bugs/view.php?id=2924 
====================================================================== 
Reported By:                kiltedknight
Assigned To:                BusyBox
====================================================================== 
Project:                    BusyBox
Issue ID:                   2924
Category:                   New Features
Reproducibility:            always
Severity:                   feature
Priority:                   normal
Status:                     closed
Resolution:                 open
Fixed in Version:           
====================================================================== 
Date Submitted:             04-14-2008 13:17 PDT
Last Modified:              04-14-2008 15:58 PDT
====================================================================== 
Summary:                    ash does not parse "${varname:begin:end}" for
substring creation/checking
Description: 
The shell construct:

${varname:begin:end} does not produce the substring of $varname starting
at begin and going to end.

example:

#!/bin/ash

mystr="This is a string"
echo $mystr
mysubstr=${mystr:0:4}
echo $mysubstr
#end of example

Expected output:
This is a string
This

Actual output:
This is a string
./testscript: line 5: syntax error: Bad substitution



====================================================================== 

---------------------------------------------------------------------- 
 vapier - 04-14-08 14:47  
---------------------------------------------------------------------- 
substring's are a bashism ... they are not part of any standard

i dont think we should go adding bashism's to ash 

---------------------------------------------------------------------- 
 vda - 04-14-08 15:58  
---------------------------------------------------------------------- 
Fixed in svn, will appear in 1.11.0:

# ./busybox ash z
This is a string
This 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
04-14-08 13:17  kiltedknight   New Issue                                    
04-14-08 13:17  kiltedknight   Status                   new => assigned     
04-14-08 13:17  kiltedknight   Assigned To               => BusyBox         
04-14-08 14:47  vapier         Note Added: 0006634                          
04-14-08 14:47  vapier         Severity                 major => feature    
04-14-08 14:47  vapier         Category                 Standards Compliance =>
New Features
04-14-08 14:52  madscientist   Issue Monitored: madscientist                    
04-14-08 15:58  vda            Status                   assigned => closed  
04-14-08 15:58  vda            Note Added: 0006644                          
======================================================================




More information about the busybox-cvs mailing list