A script generates log files with tens of kilolines, and most lines are very long. It would be great to make this log human-friendly with a few edits.
At run time, there are helpful environment variables. Say, ${X}
corresponds to
/usr/projects/draco/vendors/spack.tt.developmental/spack.tt.2017-12-06.with-flags/opt/spack/cray-CNL-haswell/intel-17.0.4/gsl-2.4-zagfxq3p5iorh7viw4gc24bwzlx2tyk7
My goal is to use the environment variables to find lines like
Leaving directory /usr/projects/draco/vendors/spack.tt.developmental/spack.tt.2017-12-06.with-flags/opt/spack/cray-CNL-haswell/intel-17.0.4/gsl-2.4-zagfxq3p5iorh7viw4gc24bwzlx2tyk7
and supplant them with a convenient placeholder, here gsl-install
Leaving directory gsl-install
My efforts include an unsuccessful syntax like this
sed -i -e 's/${X}/gsl-install/g' tedious.log
How can I provide sed
an environment variable and have corresponding strings replaced?
$ uname -a
Darwin ***.***.*** 16.7.0 Darwin Kernel Version 16.7.0: Thu Jun 15 17:36:27 PDT 2017; root:xnu-3789.70.16~2/RELEASE_X86_64 x86_64
gsl-install
come from? I don't see it in the origin string. – igal Dec 07 '17 at 00:42gsl-install
from, but you could quickly convert it toLeaving directory gsl-2.4-zagfxq3p5iorh7viw4gc24bwzlx2tyk7
– Tigger Dec 07 '17 at 00:42diff
across these log files. – dantopa Dec 07 '17 at 00:54