scripts/functions
changeset 1017 34267fb0912e
parent 965 45ddf096def1
child 1022 7b3e8b8d392e
     1.1 --- a/scripts/functions	Thu Oct 23 13:45:48 2008 +0000
     1.2 +++ b/scripts/functions	Wed Oct 29 22:27:30 2008 +0000
     1.3 @@ -319,7 +319,7 @@
     1.4              # Find all interfaces and build locally accessible networks
     1.5              server_ip=$(ping -c 1 -W 2 "${CT_PROXY_HOST}" |head -n 1 |sed -r -e 's/^[^\(]+\(([^\)]+)\).*$/\1/;' || true)
     1.6              CT_TestOrAbort "SOCKS proxy '${CT_PROXY_HOST}' has no IP." -n "${server_ip}"
     1.7 -            /sbin/ifconfig |awk -v server_ip="${server_ip}" '
     1.8 +            /sbin/ifconfig |gawk -v server_ip="${server_ip}" '
     1.9                  BEGIN {
    1.10                      split( server_ip, tmp, "\\." );
    1.11                      server_ip_num = tmp[1] * 2^24 + tmp[2] * 2^16 + tmp[3] * 2^8 + tmp[4] * 2^0;
    1.12 @@ -751,13 +751,13 @@
    1.13      CT_DoLog DEBUG "  Saving environment and aliases"
    1.14      # We must omit shell functions, and some specific bash variables
    1.15      # that break when restoring the environment, later. We could do
    1.16 -    # all the processing in the awk script, but a sed is easier...
    1.17 -    set |awk '
    1.18 -             BEGIN { _p = 1; }
    1.19 -             $0~/^[^ ]+ \(\)/ { _p = 0; }
    1.20 -             _p == 1
    1.21 -             $0 == "}" { _p = 1; }
    1.22 -             ' |sed -r -e '/^BASH_(ARGC|ARGV|LINENO|SOURCE|VERSINFO)=/d;
    1.23 +    # all the processing in the gawk script, but a sed is easier...
    1.24 +    set |gawk '
    1.25 +              BEGIN { _p = 1; }
    1.26 +              $0~/^[^ ]+ \(\)/ { _p = 0; }
    1.27 +              _p == 1
    1.28 +              $0 == "}" { _p = 1; }
    1.29 +              ' |sed -r -e '/^BASH_(ARGC|ARGV|LINENO|SOURCE|VERSINFO)=/d;
    1.30                             /^(UID|EUID)=/d;
    1.31                             /^(FUNCNAME|GROUPS|PPID|SHELLOPTS)=/d;' >"${state_dir}/env.sh"
    1.32