Não tenho ideia sobre awk
, no entanto, conheço o caminho com shell
+ sed
:
file='wot-;wit-;wet-;wat.txt';
echo -n "type digits : ";
read nos;
# this is used to sort numbers in order, otherwise the script
# will work only when user specifies numbers in right order
# also we delete all non-numbers string to make sed code safe enough
nos="$(echo $nos|tr ' ' '\n'|sort -n|grep -v '[^0-9]'|tr '\n' ' ')"
# here we build sed code and modify the text
echo "$file" | { for i in $nos ; do A="s/-/+/$i;$A" ; done ; sed "$A" ; }