[BusyBox 0002024]: Command substitution in busybox-1.8.2 does not work

bugs at busybox.net bugs at busybox.net
Sun Feb 10 11:13:39 UTC 2008


The following issue has been CLOSED 
====================================================================== 
http://busybox.net/bugs/view.php?id=2024 
====================================================================== 
Reported By:                Craig
Assigned To:                BusyBox
====================================================================== 
Project:                    BusyBox
Issue ID:                   2024
Category:                   Standards Compliance
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     closed
Resolution:                 open
Fixed in Version:           
====================================================================== 
Date Submitted:             02-02-2008 19:35 PST
Last Modified:              02-10-2008 03:13 PST
====================================================================== 
Summary:                    Command substitution in busybox-1.8.2 does not work
Description: 
I have busybox in /tmp/myroot

# mount -t proc proc /tmp/myroot/proc/
# chroot /tmp/myroot/ /bin/sh
/ # sed -n 's/^ *\([0-9]\+\) \+misc$/\1/p' /proc/devices
10
/ # A=`sed -n 's/^ *\([0-9]\+\) \+misc$/\1/p' /proc/devices`
/ # echo $A
                                
/ # A=`ls`
/ # echo $A
bin dev devmap_mknod.sh etc linuxrc new proc usr
/ # 

Somehow the substitution does not work for the sed line, any hints? What's
wrong here? I'm desperate :(

If interested, also see:
http://www.mail-archive.com/busybox@busybox.net/msg02975.html
====================================================================== 

---------------------------------------------------------------------- 
 vda - 02-03-08 14:09  
---------------------------------------------------------------------- 
Please post your .config 

---------------------------------------------------------------------- 
 iluxa - 02-10-08 00:30  
---------------------------------------------------------------------- 
I have the same problem. .config attached. 

---------------------------------------------------------------------- 
 iluxa - 02-10-08 01:21  
---------------------------------------------------------------------- 
OK. Seems that the problem is related to the way sed handles output. Seems
like in case it's not line-buffered, it somehow gets discarded (FILE*
isn't getting flushed/closed?). I didn't track exact problem down, but
attached patch seems to
get me where I need (it simply flushes output file every time something is
written to it). 

---------------------------------------------------------------------- 
 iluxa - 02-10-08 01:46  
---------------------------------------------------------------------- 
Bah. Turns out I forgot to remove -Wl,--gc-sections from scripts/trylink... 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
02-02-08 19:35  Craig          New Issue                                    
02-02-08 19:35  Craig          Status                   new => assigned     
02-02-08 19:35  Craig          Assigned To               => BusyBox         
02-03-08 14:09  vda            Note Added: 0003654                          
02-10-08 00:30  iluxa          File Added: .config                          
02-10-08 00:30  iluxa          Note Added: 0003774                          
02-10-08 01:21  iluxa          Note Added: 0003794                          
02-10-08 01:21  iluxa          File Added: sed-subst.patch                    
02-10-08 01:46  iluxa          Note Added: 0003804                          
02-10-08 03:13  vda            Status                   assigned => closed  
======================================================================




More information about the busybox-cvs mailing list