Re:Useful sed scripts and patterns
by sam_lowry_ on Friday November 12, 2021 @02:59AM
(#29197214)
You need to have a mental model for each tool and some idea of syntax associated with it. Once I learned about IFS,OFS, BEGIN, END and {}, as well as the fact that variables and their references have the same syntax, unlike in Perl... I could pick up coding in awk at any moment
[ Parent
| on HN ]
Perl has BEGIN and END as well, and when using it with -n or -p for line processing mode uses -F to set word boundaries just like awk. In fact, it shared many flags and features with awk, which it was meant to be able to be used as a more powerful version of the same tool.
IFS is the POSIX shell; in awk, it's just FS.
I think by {} you mean an argument to the find command.
Re:Useful sed scripts and patterns
by sam_lowry_ on Saturday November 13, 2021 @05:18AM
(#29208797)
Indeed. Thanks for the hint.