

InterviewSolution
1. |
Solve : duplicate : how to remove varible from a list? |
Answer» hey I am doing something like following:
Solve teh problem of by using following : Code: [Select]var1=$(echo $var1 | sed "s/$var//") But STILL How can i select the random varible from the list Question is there. Please suggest.make an array of variable in list , find the index of that array . Do Code: [Select]X=rand()%index to generate the random number and with that random number go to the array element : Code: [Select]array [x] This will give you the random selection for each time. Thanks RGhello i dont know which language you are working on...but from my experience.. are the syntax correct? u declare var1='1 2 3 4 5' then u said for var in $var1 i think you should declare var1 as $var1='1 2 3 4 5' and for $var in $var1 |
|