🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.bash.bug
Article #163

YA Bash functions incompatibility with sh?

#163
From: Brian Glendenning
Date: Wed, 28 Jun 1989 03:58
44 lines
1336 bytes
I believe I may have found another incompatibility between sh and
bash (maybe I should get brave and call it a bug :-).

sh:
$ del() { /bin/rm -i $* ; }
$ touch junk
$ del junk
rm: remove junk? ^C
$ echo $*

$

bash:
$ del() { /bin/rm -i $* ; }
$ touch junk
$ del junk
rm: remove junk? ^C
$ echo $*
junk
$ 


This would not be so bad, except that it appears that if $* is set it
is not reset properly upon entry to other shell functions (at least),
e.g.:

bash:
$ del() { /bin/rm -i $* ; }
$ lf() { /bin/ls -F $* ; }
$ touch junk
$ del junk
rm: remove junk? ^C
$ mv junk trash
$ lf
junk not found
$ 

--
	  Brian Glendenning - Radio astronomy, University of Toronto
brian@radio.astro.utoronto.ca uunet!utai!radio!brian  glendenn@utorphys.bitnet
-- 
	  Brian Glendenning - Radio astronomy, University of Toronto
brian@radio.astro.utoronto.ca uunet!utai!radio!brian  glendenn@utorphys.bitnet
Technical Details
Message-ID: <BRIAN.89Jun27235835@radio.astro.utoronto.ca>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!radio.astro!brian

Show Full Headers
Complete Article Headers
Newsgroups: gnu.bash.bug
Path: arc1-ca.pugleaf.net!utzoo!utgpu!radio.astro!brian
From: brian@radio.astro.utoronto.ca (Brian Glendenning)
Subject: YA Bash functions incompatibility with sh?
Message-ID: <BRIAN.89Jun27235835@radio.astro.utoronto.ca>
Sender: brian@radio.astro.utoronto.ca (Brian Glendenning)
Organization: Radio Astronomy, Univeristy of Toronto
Distribution: gnu
Date: Wed, 28 Jun 89 03:58:42 GMT