This question already has an answer here:
- Addition with 'sed' 11 answers
I am not sure whether the below statement can be done placing & inside $() so that each time & is replaced by 1,2,3,4 and 1 is added to it.
echo 1 2 3 4 | tr ' ' '\n' | sed "s/.*/$(echo expr 1 + &)/"
The above statement doesn't work
i get the output :
expr 1 + expr 1 + expr 1 + expr 1 +