Bash array using system positions limits? [closed]
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
Here is my array declaration
arraySYSTEM=( "$@" )
It can have up to 10 "system position(?)" members.
I'm using it to build text parameters passed to whiptail
function. Then I select the parameter using whiptail checklist (menu). In checklist I can have unlimited number of parameters using $number
syntax - such as $16
.
How do I modify my arraySYSTEM
declaration to have more that 10 members in an array?
bash array
closed as unclear what you're asking by Michael Homer, Thomas, G-Man, msp9011, roaima Aug 20 at 13:57
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, itâÂÂs hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
add a comment |Â
up vote
1
down vote
favorite
Here is my array declaration
arraySYSTEM=( "$@" )
It can have up to 10 "system position(?)" members.
I'm using it to build text parameters passed to whiptail
function. Then I select the parameter using whiptail checklist (menu). In checklist I can have unlimited number of parameters using $number
syntax - such as $16
.
How do I modify my arraySYSTEM
declaration to have more that 10 members in an array?
bash array
closed as unclear what you're asking by Michael Homer, Thomas, G-Man, msp9011, roaima Aug 20 at 13:57
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, itâÂÂs hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
8
Who says that array can have only up to 10 values?
â muru
Aug 20 at 4:06
If I code this way $10 it fails - highlights the "0" so $10 is OK. Perhaps using wrong syntax WAS my initial error.
â Jan Hus
Aug 20 at 16:07
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
Here is my array declaration
arraySYSTEM=( "$@" )
It can have up to 10 "system position(?)" members.
I'm using it to build text parameters passed to whiptail
function. Then I select the parameter using whiptail checklist (menu). In checklist I can have unlimited number of parameters using $number
syntax - such as $16
.
How do I modify my arraySYSTEM
declaration to have more that 10 members in an array?
bash array
Here is my array declaration
arraySYSTEM=( "$@" )
It can have up to 10 "system position(?)" members.
I'm using it to build text parameters passed to whiptail
function. Then I select the parameter using whiptail checklist (menu). In checklist I can have unlimited number of parameters using $number
syntax - such as $16
.
How do I modify my arraySYSTEM
declaration to have more that 10 members in an array?
bash array
bash array
edited Aug 22 at 7:33
ñÃÂsýù÷
15.8k92563
15.8k92563
asked Aug 20 at 3:19
Jan Hus
1266
1266
closed as unclear what you're asking by Michael Homer, Thomas, G-Man, msp9011, roaima Aug 20 at 13:57
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, itâÂÂs hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
closed as unclear what you're asking by Michael Homer, Thomas, G-Man, msp9011, roaima Aug 20 at 13:57
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, itâÂÂs hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
8
Who says that array can have only up to 10 values?
â muru
Aug 20 at 4:06
If I code this way $10 it fails - highlights the "0" so $10 is OK. Perhaps using wrong syntax WAS my initial error.
â Jan Hus
Aug 20 at 16:07
add a comment |Â
8
Who says that array can have only up to 10 values?
â muru
Aug 20 at 4:06
If I code this way $10 it fails - highlights the "0" so $10 is OK. Perhaps using wrong syntax WAS my initial error.
â Jan Hus
Aug 20 at 16:07
8
8
Who says that array can have only up to 10 values?
â muru
Aug 20 at 4:06
Who says that array can have only up to 10 values?
â muru
Aug 20 at 4:06
If I code this way $10 it fails - highlights the "0" so $10 is OK. Perhaps using wrong syntax WAS my initial error.
â Jan Hus
Aug 20 at 16:07
If I code this way $10 it fails - highlights the "0" so $10 is OK. Perhaps using wrong syntax WAS my initial error.
â Jan Hus
Aug 20 at 16:07
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
4
down vote
You can have any number of entries in an array. For example:
$ set -- a..z
$ echo "$26"
z
(beware $26
is $26
in bash
and most other Bourne-like shells)
Ditto for a named array:
$ foo=(a..z)
$ echo "$foo[25]"
z
(The indexing discrepancy is because $0
is special, usually containing the name of the current script.)
3
Note that the$26
being$26
Bourne design flaw (in the Bourne shell not even$26
worked though"$@"
still included all elements) is fixed in csh, tcsh, zsh, rc, es...
â Stéphane Chazelas
Aug 20 at 6:25
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
4
down vote
You can have any number of entries in an array. For example:
$ set -- a..z
$ echo "$26"
z
(beware $26
is $26
in bash
and most other Bourne-like shells)
Ditto for a named array:
$ foo=(a..z)
$ echo "$foo[25]"
z
(The indexing discrepancy is because $0
is special, usually containing the name of the current script.)
3
Note that the$26
being$26
Bourne design flaw (in the Bourne shell not even$26
worked though"$@"
still included all elements) is fixed in csh, tcsh, zsh, rc, es...
â Stéphane Chazelas
Aug 20 at 6:25
add a comment |Â
up vote
4
down vote
You can have any number of entries in an array. For example:
$ set -- a..z
$ echo "$26"
z
(beware $26
is $26
in bash
and most other Bourne-like shells)
Ditto for a named array:
$ foo=(a..z)
$ echo "$foo[25]"
z
(The indexing discrepancy is because $0
is special, usually containing the name of the current script.)
3
Note that the$26
being$26
Bourne design flaw (in the Bourne shell not even$26
worked though"$@"
still included all elements) is fixed in csh, tcsh, zsh, rc, es...
â Stéphane Chazelas
Aug 20 at 6:25
add a comment |Â
up vote
4
down vote
up vote
4
down vote
You can have any number of entries in an array. For example:
$ set -- a..z
$ echo "$26"
z
(beware $26
is $26
in bash
and most other Bourne-like shells)
Ditto for a named array:
$ foo=(a..z)
$ echo "$foo[25]"
z
(The indexing discrepancy is because $0
is special, usually containing the name of the current script.)
You can have any number of entries in an array. For example:
$ set -- a..z
$ echo "$26"
z
(beware $26
is $26
in bash
and most other Bourne-like shells)
Ditto for a named array:
$ foo=(a..z)
$ echo "$foo[25]"
z
(The indexing discrepancy is because $0
is special, usually containing the name of the current script.)
edited Aug 20 at 6:12
Stéphane Chazelas
285k53525864
285k53525864
answered Aug 20 at 4:27
l0b0
26.3k17106231
26.3k17106231
3
Note that the$26
being$26
Bourne design flaw (in the Bourne shell not even$26
worked though"$@"
still included all elements) is fixed in csh, tcsh, zsh, rc, es...
â Stéphane Chazelas
Aug 20 at 6:25
add a comment |Â
3
Note that the$26
being$26
Bourne design flaw (in the Bourne shell not even$26
worked though"$@"
still included all elements) is fixed in csh, tcsh, zsh, rc, es...
â Stéphane Chazelas
Aug 20 at 6:25
3
3
Note that the
$26
being $26
Bourne design flaw (in the Bourne shell not even $26
worked though "$@"
still included all elements) is fixed in csh, tcsh, zsh, rc, es...â Stéphane Chazelas
Aug 20 at 6:25
Note that the
$26
being $26
Bourne design flaw (in the Bourne shell not even $26
worked though "$@"
still included all elements) is fixed in csh, tcsh, zsh, rc, es...â Stéphane Chazelas
Aug 20 at 6:25
add a comment |Â
8
Who says that array can have only up to 10 values?
â muru
Aug 20 at 4:06
If I code this way $10 it fails - highlights the "0" so $10 is OK. Perhaps using wrong syntax WAS my initial error.
â Jan Hus
Aug 20 at 16:07