Saturday 24 July 2021

Concatenate inputs in string while in loop

 SOURCES="a b c d e"

DESTINATIONS=""

for src in $SOURCES
do
    echo Input destination to associate to the source $src:
    read dest
    DESTINATIONS+=" ${dest}"
done
echo $DESTINATIONS


from: https://stackoverflow.com/questions/42934198/concatenate-inputs-in-string-while-in-loop

No comments:

Post a Comment