Artificial intelligent assistant

Get variables in two separate lines I have the file ole.txt: A B C 1 2 3 a b c 11 22 33 with option A: cat ole.txt | sed -n -e 1p -e 3p we get: A B C a b c with option B: sox=$(cat ole.txt | sed -n -e 1p -e 3p) echo $sox we get: A B C a b c How can I change the code in option B to get the result in option A (the result as 2 rows)?

_Quotes_ is the answer.


echo "$sox"


should do the trick. If you don't want a newline at the end, you can use


printf "$sox"


Taking a look at the Linux Documentation Project's page on quoting variables might help you understand better what weak quotes, i.e. **"** , entail.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 911ccffd3c4ae7ec7bd720757ebc0515