Path: csiph.com!goblin2!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail From: L A Walsh Newsgroups: gnu.bash.bug Subject: continued alias problem -- some work, some don't, why? Date: Mon, 08 Jul 2019 15:30:47 -0700 Lines: 43 Approved: bug-bash@gnu.org Message-ID: References: <5D23C417.5060108@tlinx.org> NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: usenet.stanford.edu 1562625063 30652 209.51.188.17 (8 Jul 2019 22:31:03 GMT) X-Complaints-To: action@cs.stanford.edu To: bug-bash Envelope-to: bug-bash@gnu.org User-Agent: Thunderbird X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] X-Received-From: 173.164.175.65 X-BeenThere: bug-bash@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Bug reports for the GNU Bourne Again SHell List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: <5D23C417.5060108@tlinx.org> Xref: csiph.com gnu.bash.bug:15090 I have been trying to use something like a continued alias (space following the expansion). So I have several modifies on a var my -a -i -x foobar=(1 2 3) my -p foobar declare -aix foobar=([0]="1" [1]="2" [2]="3") That's what I am wanting, But trying various aliases, I'm not getting consistent results: With these aliases: alias my='declare ' alias Export='-x ' alias Map='-A ' alias Int='-i ' my Export Map Int ffffe=([one]=1) -bash: declare: `-x': not a valid identifier -bash: declare: `-A': not a valid identifier -bash: declare: `-i': not a valid identifier But: this does: declare -x -A -i foo7=([one]=1 [two]=2)> my -p foo7 my -p foo7 declare -Aix foo7=([two]="2" [one]="1" ) Part of it appears to be the word Export in a declaration -- will tend to ignore other things, but using the flag -x, will set the flag w/no error. So why do aliases of '-x ' not work where a bare '-x' do?. Annoying is when you get some error trying to create a map, -- then the var will be created as an array, which, if you don't catch it makes future attempt to create a map of the same name fruitless.