How can this line from a BASH script be optimized to work faster in removing the first and last lines of a directory full of XML files?
sed -s -i -e 1d ./files/to/edit/*.xml && sed -s -i -e '$d' ./files/to/edit/*.xml
The sed command does not have to be used. Any BASH code will work; python3 would also be nice.
Try that :
It’s faster, see :