Reputation: 789
Please help using shell
script for below statement
My input is below
a=abc,def,ghi
My output should be as below
a=h.abc,h.def,h.ghi
How can I achieve this in shell scripting please help
Upvotes: 1
Views: 69
Reputation: 3914
Use this
export IFS=","
words="abc,def,ghi"
for word in $words; do
echo "h.$word"
done
If you want to print output in the same line use echo -n
Upvotes: 1