get index of an element in array in bash
I have an array say
Code:
array_name=( XXX YYY ZZZ aaa bbb ccc) I don't want to use loop, since it is a part of a larger program and looping will really make it complex I'm using GNU bash, version 3.2.33(1)-release (i386-redhat-linux-gnu) |
Code:
echo ${!array_name[@]} |
Quote:
Sir thank you for your reply but I still didn't get it. The above code give me following output Code:
0 1 2 3 4 5 |
do it loop. Its really not that complex. after you done it, make a function out of it, so that next time, you can use it again
|
Thank you Sir,
This is second time you are helping me in this week sir. I had solved the problem in the same manner before your last post though :P Once again, I'm really grateful to you |
All times are GMT -5. The time now is 08:17 AM. |