summaryrefslogtreecommitdiff
path: root/scripts/functions
diff options
context:
space:
mode:
authorYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2008-10-29 22:27:30 (GMT)
committerYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2008-10-29 22:27:30 (GMT)
commita5bbab574f7adc63180af6c9d24546b117d31b80 (patch)
tree6ce6d2c50b1fde391d3f912c7d3cc02bacf84ca3 /scripts/functions
parentd31396bc23bb78ed3d17ea3fdd3274ef7a8bdec1 (diff)
Use 'gawk', not plain 'awk'.
We need GNU Awk? Then check for, and use 'gawk', not plain 'awk'. Be a little mre verbose if a tool was not found. /trunk/configure | 7 4 3 0 ++++--- /trunk/scripts/build/kernel/linux.sh | 2 1 1 0 +- /trunk/scripts/functions | 16 8 8 0 ++++++++-------- /trunk/scripts/saveSample.sh | 4 2 2 0 ++-- 4 files changed, 15 insertions(+), 14 deletions(-)
Diffstat (limited to 'scripts/functions')
-rw-r--r--scripts/functions16
1 files changed, 8 insertions, 8 deletions
diff --git a/scripts/functions b/scripts/functions
index d69d549..b1db160 100644
--- a/scripts/functions
+++ b/scripts/functions
@@ -319,7 +319,7 @@ CT_DoSetProxy() {
# Find all interfaces and build locally accessible networks
server_ip=$(ping -c 1 -W 2 "${CT_PROXY_HOST}" |head -n 1 |sed -r -e 's/^[^\(]+\(([^\)]+)\).*$/\1/;' || true)
CT_TestOrAbort "SOCKS proxy '${CT_PROXY_HOST}' has no IP." -n "${server_ip}"
- /sbin/ifconfig |awk -v server_ip="${server_ip}" '
+ /sbin/ifconfig |gawk -v server_ip="${server_ip}" '
BEGIN {
split( server_ip, tmp, "\\." );
server_ip_num = tmp[1] * 2^24 + tmp[2] * 2^16 + tmp[3] * 2^8 + tmp[4] * 2^0;
@@ -751,13 +751,13 @@ CT_DoSaveState() {
CT_DoLog DEBUG " Saving environment and aliases"
# We must omit shell functions, and some specific bash variables
# that break when restoring the environment, later. We could do
- # all the processing in the awk script, but a sed is easier...
- set |awk '
- BEGIN { _p = 1; }
- $0~/^[^ ]+ \(\)/ { _p = 0; }
- _p == 1
- $0 == "}" { _p = 1; }
- ' |sed -r -e '/^BASH_(ARGC|ARGV|LINENO|SOURCE|VERSINFO)=/d;
+ # all the processing in the gawk script, but a sed is easier...
+ set |gawk '
+ BEGIN { _p = 1; }
+ $0~/^[^ ]+ \(\)/ { _p = 0; }
+ _p == 1
+ $0 == "}" { _p = 1; }
+ ' |sed -r -e '/^BASH_(ARGC|ARGV|LINENO|SOURCE|VERSINFO)=/d;
/^(UID|EUID)=/d;
/^(FUNCNAME|GROUPS|PPID|SHELLOPTS)=/d;' >"${state_dir}/env.sh"