Search Results

Search: Posts Made By: dring
16,939
Posted By kumaran_5555
You have to use when you want to build a variable...
You have to use when you want to build a variable name using another variable. like dir_1 using variable n.


cgi@tioman> (/home/cgi) $ dir_1="abc"
cgi@tioman> (/home/cgi) $ n=1
cgi@tioman>...
16,939
Posted By mirni
Welcome to the forum! As far as I know, bash...
Welcome to the forum!

As far as I know, bash doesn't allow such thing as ${dir_$n}.
I'd use array instead:
dir[$a]=someValue;
echo ${dir[$a]}
Array indices can be strings, too.

To loop...
Showing results 1 to 2 of 2

 
All times are GMT -4. The time now is 04:09 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy