I thought I should start a new thread for this one.
I've incorporated quirkasaurus' suggestion to use vi to swap lines in my file:
vi $file << EOF
:14mo26
:25mo13
:wq
EOF
The problem is I can only get this to work if it's in a separate script which I call from my original one. If I put the code directly into my original script the execution terminates at the EOF. I've tried scattering quotes and brackets around but I can't figure out how to stop EOF ending the script - it's not essential to sort this as it work fine but would be tidier all in one script. Any ideas?
Thanks, Chris
I've incorporated quirkasaurus' suggestion to use vi to swap lines in my file:
vi $file << EOF
:14mo26
:25mo13
:wq
EOF
The problem is I can only get this to work if it's in a separate script which I call from my original one. If I put the code directly into my original script the execution terminates at the EOF. I've tried scattering quotes and brackets around but I can't figure out how to stop EOF ending the script - it's not essential to sort this as it work fine but would be tidier all in one script. Any ideas?
Thanks, Chris