The 'awk' command 
r...@per-r1:~# dpkg -l | grep awk
ii  gawk                                      1:3.1.6.dfsg-0ubuntu1
GNU awk, a pattern scanning and processing l
ii  mawk                                      1.3.3-13ubuntu1
a pattern scanning and text processing langu
r...@per-r1:~# awk -h
Usage: awk [POSIX or GNU style options] -f progfile [--] file ...
Usage: awk [POSIX or GNU style options] [--] 'program' file ...
POSIX options:          GNU long options:
        -f progfile             --file=progfile
        -F fs                   --field-separator=fs
        -v var=val              --assign=var=val
        -m[fr] val
        -W compat               --compat
        -W copyleft             --copyleft
        -W copyright            --copyright
        -W dump-variables[=file]        --dump-variables[=file]
        -W exec=file            --exec=file
        -W gen-po               --gen-po
        -W help                 --help
        -W lint[=fatal]         --lint[=fatal]
        -W lint-old             --lint-old
        -W non-decimal-data     --non-decimal-data
        -W profile[=file]       --profile[=file]
        -W posix                --posix
        -W re-interval          --re-interval
        -W source=program-text  --source=program-text
        -W traditional          --traditional
        -W usage                --usage
        -W use-lc-numeric       --use-lc-numeric
        -W version              --version

To report bugs, see node `Bugs' in `gawk.info', which is
section `Reporting Problems and Bugs' in the printed version.

gawk is a pattern scanning and processing language.
By default it reads standard input and writes standard output.

Examples:
        gawk '{ sum += $1 }; END { print sum }' file
        gawk -F: '{ print $1 }' /etc/passwd


'shorewall save' shows a similar pause on your system - YES

-Trent
-----Original Message-----
From: Tom Eastep [mailto:[email protected]] 
Sent: Wednesday, 16 June 2010 11:28 AM
To: [email protected]
Subject: [Shorewall-users] [SPAM] Re: When starting a firewall setup...

On 6/15/10 6:16 PM, Trent O'Callaghan wrote:
> Hi Tom,
> 
> For comparison I have attached the requested  'sh -x /sbin/shorewall 
> safe-restart 2> trace ' as trace-safe.txt And  'sh -x /sbin/shorewall 
> restart 2> trace-ok' as trace-ok.txt for comparison.
> 
> The process wait during safe-restart (150 seconds) is occurring 
> during;
> + awk BEGIN           { sline=""; };\
>              /^-j/           { print sline $0; next };\
>              /-m policy.*-j/ { print $0; next };\
>              /-m policy/     { sline=$0; next };\
>              /--mask ff/     { sub( /--mask ff/, "--mask 0xff" ) };\
>                              { print ; sline="" }

You apparently possess insight which I lack; the above invocation of 'awk'
is part of a pipeline of two commands; from the source:

do_save() {
    local status
    status=0

    if [ -f ${VARDIR}/firewall ]; then
        if $iptables_save | iptablesbug > ${VARDIR}/restore-$$; then
            cp -f ${VARDIR}/firewall $g_restorepath
            mv -f ${VARDIR}/restore-$$ ${g_restorepath}-iptables
            chmod +x $g_restorepath
            echo "   Currently-running Configuration Saved to
$g_restorepath"

The 'awk' command ia the active statement in 'iptablesbug (if awk isn't
installed, iptablesbug runs 'cat'). So it is still not obvious why your
system produces the awkward pause (pun intended :-) ).

Does 'shorewall save' show a similar pause on your system?

-Tom
-- 
Tom Eastep        \ When I die, I want to go like my Grandfather who
Shoreline,         \ died peacefully in his sleep. Not screaming like
Washington, USA     \ all of the passengers in his car
http://shorewall.net \________________________________________________



------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Shorewall-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/shorewall-users

Reply via email to