3 # Copyright (C) - 2019 Jonathan Rajotte-Julien <jonathan.rajotte-julien@efficios.com>
5 # This library is free software; you can redistribute it and/or modify it under
6 # the terms of the GNU Lesser General Public License as published by the Free
7 # Software Foundation; version 2.1 of the License.
9 # This library is distributed in the hope that it will be useful, but WITHOUT
10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11 # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
14 # You should have received a copy of the GNU Lesser General Public License
15 # along with this library; if not, write to the Free Software Foundation, Inc.,
16 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 function get_env_value
()
25 result
=$
(grep "$key" < "$env_file")
27 if [ $ret -eq 1 ]; then
28 echo "invalid_value_extraction"
31 # Strip the key using bash substring removal.
32 # This remove all leading chars until the actual value.
35 # Remove the trailing ';'
38 # Remove enclosing '"' if present
39 if [ "${result:0:1}" == '"' ]; then
48 function iso8601_to_lttng_dir_datetime
()
54 # Remove trailing timezone information including the '-'.