🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.bash.bug
Article #933

Re: alias

#933
From: Mark D. Baushke
Date: Thu, 03 Sep 1992 20:04
21 lines
1019 bytes
On 31 Aug 92 15:28:19 GMT, svb@cs.purdue.edu (Stephan Bechtolsheim) said:

stvb> How do you get, in an alias, the rest of the command line expanded?
stvb> If I write
stvb> alias xx='echo abc 777 def'
stvb> and
stvb> xx this is fun
stvb> should print
stvb> abc this is fun def

stvb> What do I need to write instead of the '777'? Could not find
stvb> anything in the documentation. It's a bug in that it's not
stvb> documented .......  Verson 1.12.....

aliases do not do expansion. use a function instead:

function xx () { echo abc $* def }


	Enjoy!
	-- Mark
Technical Details
Message-ID: <MDB.92Sep3120428@regal.cisco.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!regal.cisco.com!mdb
References: mdb@regal.cisco.com (Mark D. Baushke)

Show Full Headers
Complete Article Headers
Newsgroups: gnu.bash.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!regal.cisco.com!mdb
From: mdb@regal.cisco.com (Mark D. Baushke)
Subject: Re: alias
Message-ID: <MDB.92Sep3120428@regal.cisco.com>
Sender: gnulists@ai.mit.edu
Organization: cisco Systems Inc., Menlo Park, CA, USA
References: mdb@regal.cisco.com (Mark D. Baushke)
Distribution: gnu
Date: Thu, 3 Sep 1992 20:04:28 GMT
Approved: bug-bash@prep.ai.mit.edu
Lines: 22