Bug 649

Summary: ash/hush do not expand paths before setting up redirection
Product: Busybox Reporter: Mike Frysinger <vapier>
Component: Standard ComplianceAssignee: unassigned
Status: RESOLVED WONTFIX    
Severity: enhancement CC: busybox-cvs
Priority: P5    
Version: 1.14.x   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Host: Target:
Build:

Description Mike Frysinger 2009-10-06 03:30:43 UTC
same behavior is observed with ash and hush:
$ rm -rf a
$ mkdir a
$ touch a/f
$ > */f
sh: can't create */f: nonexistent directory
Comment 1 Denys Vlasenko 2009-10-06 16:01:50 UTC
It's a bashism. bash does it only is you run it as "bash"

# bash -c 'rm -rf www; mkdir www; touch www/test; echo Hey >ww*/test; echo $?'
0

# sh -c 'rm -rf www; mkdir www; touch www/test; echo Hey >ww*/test; echo $?'
sh: ww*/test: No such file or directory
1

ash and hush do the same as "bash as sh":

# ash -c 'rm -rf www; mkdir www; touch www/test; echo Hey >ww*/test; echo $?'
ash: can't create ww*/test: nonexistent directory
1

# hush -c 'rm -rf www; mkdir www; touch www/test; echo Hey >ww*/test; echo $?'
hush: can't open 'ww*/test': No such file or directory
1
Comment 2 Mike Frysinger 2009-10-06 19:27:04 UTC
my mistake, i thought path expansion was supposed to occur first