#!/usr/bin/env bash #------------------------------------------------------------------------------# # This file is part of the PALM model system. # # PALM is free software: you can redistribute it and/or modify it under the terms # of the GNU General Public License as published by the Free Software Foundation, # either version 3 of the License, or (at your option) any later version. # # PALM is distributed in the hope that it will be useful, but WITHOUT ANY # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR # A PARTICULAR PURPOSE. See the GNU General Public License for more details. # # You should have received a copy of the GNU General Public License along with # PALM. If not, see . # # Copyright 2018-2021 Leibniz Universitaet Hannover #------------------------------------------------------------------------------# # # Current revisions: # ------------------ # # # Former revisions: # ----------------- # $Id: palm_find_lowest_available_log_point_index 4843 2021-01-15 15:22:11Z banzhafs $ # Initial revision # #------------------------------------------------------------------------------# # palm_find_lowest_available_log_point_index does what its name indicates #------------------------------------------------------------------------------# SOURCE="${BASH_SOURCE[0]}" while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" SOURCE="$(readlink "$SOURCE")" # if $SOURCE was a relative symlink, we need to resolve it # relative to the path where the symlink file was located [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" done SCRIPT_LOCATION="$( cd -P "$( dirname "$SOURCE" )" && pwd )" working_dir=$(readlink -f "${SCRIPT_LOCATION}/../../") trunk_dir=$(readlink -f "${SCRIPT_LOCATION}/../") contains() { [[ ${1} =~ (^|[[:space:]])${2}($|[[:space:]]) ]] && return 0 || return 1 } all_found_log_point=$(grep -P "CALL +cpu_log\( +log_point\(" ${trunk_dir}/SOURCE/* \ | grep -oP "(?