Ask Ubuntu General Room

Normally: General discussion around Ask Ubuntu, Ubuntu & offic...
Jes
Aug 25, 2016 14:02
did someone work with this
Jes
Aug 25, 2016 13:58
am stuck with something for days
Jes
Aug 25, 2016 13:58
did anyone work with aws cli commands?
Jes
Aug 25, 2016 13:58
good morning
Jes
Aug 25, 2016 13:58
Hi folks
Jes
Aug 11, 2016 11:33
ok
Jes
Aug 11, 2016 11:32
i am getting this error 'Z1MSGZ': not found
Jes
Aug 11, 2016 11:30
what should be my IFS?
Jes
Aug 11, 2016 11:30
'Z1MSGZ','XSD9VQ6I','Z2450W','V31THVZL'
Jes
Aug 11, 2016 11:30
@Arronical my string is this
Jes
Aug 11, 2016 11:21
is this correct
Jes
Aug 11, 2016 11:20
OIFS=$IFS;
IFS=',';
ids=$($hostIds);
for i in "${ids[@]}"
do
echo "${ids[$i]}"
done
IFS=$OIFS;
Jes
Aug 11, 2016 11:20
@Arronical thanks but now i changed the string
Jes
Aug 11, 2016 10:55
0
Q: how to convert a string into an array in bash script

JesI am trying to convert a string separated with whitespace into an array and loop that array to pass each value as a param to a bash command. I am getting bad substitution message when i execute the scripts. text = xdc cde erd ded ded kie dei sess; OIFS=$IFS; IFS=" "; ids=$($text); for (i=0; i<$...

Jes
Aug 11, 2016 10:54
like xsws sxsw sxsw rwss reds
Jes
Aug 11, 2016 10:54
@Arronical it is separated with space
Jes
Aug 11, 2016 10:53
yes
Jes
Aug 11, 2016 10:40
stackoverflow.com/a/19657765/896340 this is exactly what i am trying to achieve
Jes
Aug 11, 2016 10:39
@Arronical does that make any sense
Jes
Aug 11, 2016 10:39
OIFS=$IFS;
IFS=" ";
ids=$($hostIds);
for (i=0; i<${#ids[@]}; ++i);
do
#for i in "${ids[@]}"
#do
echo "${ids[$i]}"
done
IFS=$OIFS;
Jes
Aug 11, 2016 10:39
i just modified the script like this
Jes
Aug 11, 2016 10:37
@Arronical
Jes
Aug 11, 2016 10:37
my string is rerrrr xcder xswed xcdess
Jes
Aug 11, 2016 10:37
i am converting a string into an array
Jes
Aug 11, 2016 10:26
i am getting bad sustitution
Jes
Aug 11, 2016 10:26
whats wrong with this loop
Jes
Aug 11, 2016 10:26
for i in "${ids[@]}"
do
echo $i
done
Jes
Aug 11, 2016 10:25
good noon
Jes
Aug 11, 2016 10:25
Hi
 

 /dev/chat

General discussion for unix.stackexchange.com. If you have a q...
Jes
Aug 11, 2016 10:45
OIFS=$IFS;
IFS=" ";
ids=$($hostIds);
for (i=0; i<${#ids[@]}; ++i);
do
echo "${ids[$i]}"
done
IFS=$OIFS;
Jes
Aug 11, 2016 10:44
and loop that array
Jes
Aug 11, 2016 10:44
I am trying to convert a string into a array
Jes
Aug 11, 2016 10:44
would you be able to help
Jes
Aug 11, 2016 10:43
i need little help with bash script
Jes
Aug 11, 2016 10:43
thanks
Jes
Aug 11, 2016 10:43
i am good
Jes
Aug 11, 2016 10:40
How are you?
Jes
Aug 11, 2016 10:40
Hi @tomas