Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > gnu.bash.bug > #15090 > unrolled thread
| Started by | L A Walsh <bash@tlinx.org> |
|---|---|
| First post | 2019-07-08 15:30 -0700 |
| Last post | 2019-07-08 15:30 -0700 |
| Articles | 1 — 1 participant |
Back to article view | Back to gnu.bash.bug
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
continued alias problem -- some work, some don't, why? L A Walsh <bash@tlinx.org> - 2019-07-08 15:30 -0700
| From | L A Walsh <bash@tlinx.org> |
|---|---|
| Date | 2019-07-08 15:30 -0700 |
| Subject | continued alias problem -- some work, some don't, why? |
| Message-ID | <mailman.526.1562625062.2688.bug-bash@gnu.org> |
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.
Back to top | Article view | gnu.bash.bug
csiph-web