why echo printing the files names ?
sinks_index=`pacmd list-sinks | grep "index:"`
for i in $sinks_index
do
echo $i
done
gives this output
audio_name_switcher.sh
audio.py
audio.sh
switch_audio.sh
index:
1
index:
2
index:
3
but running pacmd list-sinks | grep "index:" in the shell gives * index: 1 index: 2 index: 3