Dumb ass follow up question
When I use lutusp's method I can do
Code:
var=${ip%%:*}
echo $var
But because I want to learn bash, I also decided to try the other method:
The code below is not allowed
Code:
var=echo $s | cut -d: -f1
echo $var
I've tried various things, like adding () around the echo statement etc. Can someone instruct me why this assignment is not allowed?