I have a file with 19k lines like these:
a96abbb5da0985983e113a9a7484c063 management/modules/membership/file1
d7f7dd7e3ede3e323fc0e09381f16caf management/modules/invoices/path/file2
However, I would like to append the module name at the end of the line. So the result would be:
a96abbb5da0985983e113a9a7484c063 management/modules/membership/file1 membership
d7f7dd7e3ede3e323fc0e09381f16caf management/modules/invoices/path/file2 invoices
Is there a way to do this with for example sed
or something similar? Preferably without an extra file, using -i
.
The module name would always be in the path in this format: modules/MODULENAME
$AWKPATH
not to include.
or make sure you run that command from within a working directory where nobody could create a file calledinplace
orinplace.awk
. – Stéphane Chazelas Jun 24 '23 at 21:25