1
I’m having a problem making a program to exchange the first number for X, because even if it works, the variable does not receive the value permanently:
VAR="oi 200 20 10"
VAR= echo "$VAR" | sed -r -n "s/[0-9]+/X/p"
echo $VAR
It’s coming off:
oi X 20 10
oi 200 20 10
I would like to know how to get the variable to permanently receive the exchange of the first number by X, and how to get the same formatting, because sed ignores the spaces I gave and puts only one in place. I wish the way out:
oi X 20 10
oi X 20 10
Related: https://answall.com/q/327578/112052
– hkotsubo