-#!/bin/bash -exu
+#!/bin/bash
#
# Copyright (C) 2018 - Jonathan Rajotte-Julien <jonathan.rajotte-julien@efficios.com>
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+set -exu
+
PGREP=pgrep
pids=""
file_list=$(mktemp)
collect_recursive "$str"
done
- rm -f "$core_file"
+ echo "$core_file" >> $file_list
ret=1
done < <(find "/tmp" -maxdepth 1 -name "core\.[0-9]*" -type f 2>/dev/null)
tar cfzh "${WORKSPACE}/build/core.tar.gz" -T <(sort "$file_list" | uniq)
fi
+# Remove core file
+while read -r core_file; do
+ rm -rf "$core_file"
+done < <(find "/tmp" -maxdepth 1 -name "core\.[0-9]*" -type f 2>/dev/null)
+
rm -f "$file_list"
exit $ret