diff options
author | Marcin Siodelski <marcin@isc.org> | 2015-02-27 10:48:45 +0100 |
---|---|---|
committer | Marcin Siodelski <marcin@isc.org> | 2015-02-27 10:48:45 +0100 |
commit | 1e32446a96db6be248405bd6a919d0cb616a9c95 (patch) | |
tree | d8ba35fe81f19e4eed50ed3c1c9f6828db50cf29 /src/lib/testutils | |
parent | spelling typo (diff) | |
download | kea-1e32446a96db6be248405bd6a919d0cb616a9c95.tar.xz kea-1e32446a96db6be248405bd6a919d0cb616a9c95.zip |
[3651] Fixed the non portable whitespace trimming in shell tests.
Diffstat (limited to 'src/lib/testutils')
-rw-r--r-- | src/lib/testutils/dhcp_test_lib.sh.in | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/lib/testutils/dhcp_test_lib.sh.in b/src/lib/testutils/dhcp_test_lib.sh.in index ec4c4e2d41..b02e88a261 100644 --- a/src/lib/testutils/dhcp_test_lib.sh.in +++ b/src/lib/testutils/dhcp_test_lib.sh.in @@ -1,4 +1,4 @@ -# Copyright (C) 2014 Internet Systems Consortium, Inc. ("ISC") +# Copyright (C) 2014-2015 Internet Systems Consortium, Inc. ("ISC") # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above @@ -197,10 +197,9 @@ get_log_messages() { _GET_LOG_MESSAGES=0 # If log file is not present, the number of occurrences is 0. if [ -s ${LOG_FILE} ]; then - # Grep log file for the logger message occurrences. - _GET_LOG_MESSAGES=$( grep -o ${msg} ${LOG_FILE} | wc -w ) - # Remove whitespaces. - ${_GET_LOG_MESSAGES##*[! ]} + # Grep log file for the logger message occurrences and remove + # whitespaces, if any. + _GET_LOG_MESSAGES=$( grep -o ${msg} ${LOG_FILE} | wc -w | tr -d " ") fi } |