NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bin/39195: /bin/sh tilde expansion doesn't take place on 'export=~/foo'



>Number:         39195
>Category:       bin
>Synopsis:       /bin/sh tilde expansion doesn't take place on 'export=~/foo'
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jul 23 02:10:00 +0000 2008
>Originator:     Jan Schaumann
>Release:        NetBSD 4.0
>Organization:
        
>Environment:
        
        
System: NetBSD panix.netmeister.org 4.0 NetBSD 4.0 (PANIX-VC) #1: Sat Dec 22 
22:16:02 EST 2007 
root%juggler.panix.com@localhost:/misc2/obj/misc2/devel/netbsd/4.0/src/sys/arch/i386/compile/PANIX-VC
 i386
Architecture: i386
Machine: i386
>Description:

See http://mail-index.netbsd.org/tech-userlevel/2008/07/14/msg000879.html

On 14-Jul-08, at 3:00 PM, Jan Schaumann wrote:
>                                                                               
>                                
> When exactly does /bin/sh's tilde expansion take place?                       
>                                
>                                                                               
>                                
> $ /bin/sh -x                                                                  
>                                
> $ export DIR=~/tmp                                                            
>                                
> + export DIR=~/tmp                                                            
>                                
> $ ls -ld $DIR                                                                 
>                                
> + ls -ld ~/tmp                                                                
>                                
> ls: ~/tmp: No such file or directory                                          
>                                
> $ cd                                                                          
>                                
> + cd                                                                          
>                                
> $ ls -ld tmp                                                                  
>                                
> + ls -ld tmp                                                                  
>                                
> drwx------  2 jschauma  users  512 Jul  4 21:37 tmp                           
>                                
> $ ^D

Greg Woods noted:

It works fine if the variable is set first without the "export":

        15:14 [1] $ /bin/sh
        $ foobar=~/tmp
        $ echo $foobar
        /home/most/woods/tmp
        $ export foobar
        $ echo $foobar
        /home/most/woods/tmp
        $ ^D15:15 [2] $                     

>How-To-Repeat:
        /bin/sh
        mkdir ~/tmp
        export dir=~/tmp
        ls -ld $dir
>Fix:
        

>Unformatted:
        
        


Home | Main Index | Thread Index | Old Index