/usr/share/runawk/trim_in.awk is in runawk 1.6.0-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | # Written by Aleksey Cheusov <vle@gmx.net>, public domain
#
# This awk module is a part of RunAWK distribution,
# http://sourceforge.net/projects/runawk
#
############################################################
# =head2 trim_in.awk
#
# As the name of this module says (_in suffix) this module reads and
# potentially changes input lines.
#
# Leading, ending spaces and/or spaces in the middle of input lines
# are removed depending on TRIM variable.
# TRIM values:
# "l" - remove leading space characters
# "r" - remove ending space characters
# "c" - remove extra space characters in the middle of input lines
# "lr" - See l and r
# "lrc" - See l, r and c
# "lc" - See l and c
# "cr" - See c and r
# By default TRIM variable is set to "lr". TRIM set to a single space
# character means no trimming.
#
BEGIN {
if (TRIM == ""){
TRIM = "lr"
}
}
{
if (index(TRIM, "c") > 0)
gsub(/[ \t][ \t]+/, " ")
if (index(TRIM, "l") > 0)
sub(/^[ \t]+/, "")
if (index(TRIM, "r") > 0)
sub(/[ \t]+$/, "")
}
|