NetBSD-Bugs archive

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

Re: bin/48843: sh(1): break/continue/return broken inside dot commands



The following reply was made to PR bin/48843; it has been noted by GNATS.

From: David Holland <dholland-tech%netbsd.org@localhost>
To: Richard Hansen <rhansen%bbn.com@localhost>, gnats-bugs%NetBSD.org@localhost,
        tech-userlevel%NetBSD.org@localhost
Cc: 
Subject: Re: bin/48843: sh(1): break/continue/return broken inside dot
 commands
Date: Sat, 31 May 2014 23:55:48 +0000

 On Sun, Jun 01, 2014 at 02:09:41AM +0300, Jarmo Jaakkola wrote:
  > How the function call worked was one more reason I chose to implement
  > the dot command fix as I did: one could think this implementation of
  > a dot command as a function call that has no parameters (except "set --")
  > and that the function's body is stored in a file.
 
 Well... implementations other than netbsd's sh seem to allow passing
 parameters to a dot command:
 
 valkyrie% cat y2
 . ./y a b c d e
 valkyrie% cat y
 echo '$0 is '"$0"'; $@ is '"$@"
 valkyrie% sh ./y2
 $0 is ./y2; $@ is 
 valkyrie% ksh ./y2
 $0 is ./y2; $@ is a b c d e
 valkyrie% bash ./y2
 $0 is ./y2; $@ is a b c d e
 valkyrie% zsh ./y2
 $0 is ./y; $@ is a b c d e
 valkyrie% 
 
 although apparently only zsh changes $0.
 
 -- 
 David A. Holland
 dholland%netbsd.org@localhost
 


Home | Main Index | Thread Index | Old Index