Declare array but not define the array ( Shell scripting)

2014-01-09T12:35:20

There are alot of guides, guides out there which show how to declare and define an array

foo[0] = "abc" 
foo[1] = "def"

What i am trying to achieve is to declare an array but not define it because it does not have to be define immediately , in most programming languages it will look something like this

int bar[100];

Is this possible in shell scripting lanuage ??

Copyright License:
Author:「Computernerd」,Reproduced under the CC 4.0 BY-SA copyright license with link to original source & disclaimer.
Link to:https://stackoverflow.com/questions/21011655/declare-array-but-not-define-the-array-shell-scripting

About “Declare array but not define the array ( Shell scripting)” questions

There are alot of guides, guides out there which show how to declare and define an array foo[0] = "abc" foo[1] = "def" What i am trying to achieve is to declare an array but not define it becaus...
How I can save multiple file name with absolute path in one file with runtime path provided by the user using shell scripting? Can we do it using array?
I am storing output of MySQL query in a varible using shell scripting. The output of SQL query is in multiple rows. When I checked the count of the variable (which I think is an array), it is givin...
i'm learning the shell scripting using php shell.sh `#!/bin/bash BASEDIR=$(dirname $0) echo "BASE DIRECTOY $BASEDIR" ## get base directory echo "PRESENT WORKING DIRECTORY $...
I have been trying to store an integer array in a variable as a string using Unix shell scripting. e.g.: int array[2]={0,1,2} as str="123" How may I accomplish this?
In shell scripting, I have a loop with an if condition inside a for loop. for i in val1 val2 do if ((condition)) then printf ... fi done This loop returns me correct output which ...
I have executed a command that generated data in the form 111111 222222 333333 444444 555555 I have defined a variable in the command and just echo that variable which procedure this data now I wa...
I have a struct that contains a field that is an array of 7 cells and I want to define the values of the cells quickly and easily. Is there a way to easily and quickly declare and define an array s...
In shell scripting, I have a loop with an if condition inside a for loop. for ((init; condition; increment)) do if ((condition)) then printf ... fi done printf statement prints the
How can I define an array in VxWorks shell? For example if I want to have the following: myArray[3] = {1,2,3};

Copyright License:Reproduced under the CC 4.0 BY-SA copyright license with link to original source & disclaimer.