WORKSPACE=${WORKSPACE:-$PWD}
lttng_processes="$("$PGREP" -l 'lttng|gen-ust-.+')" || true
-if [ ! -z "$lttng_processes" ]; then
+if [ -n "$lttng_processes" ]; then
pids="$(cut -d ' ' -f 1 <<< "$lttng_processes" | tr '\n' ' ')"
echo "The following LTTng processes were detected running on the system and will be aborted:"
fi
core_files=$(find "/tmp" -name "core\.[0-9]*" -type f 2>/dev/null) || true
-if [ ! -z "$core_files" ]; then
+if [ -n "$core_files" ]; then
echo "$core_files" >> "$file_list"
echo "$dependencies" >> "$file_list"
mkdir -p "${WORKSPACE}/build"
tar cfzh "${WORKSPACE}/build/core.tar.gz" -T "$file_list"
- rm -rf $core_files
+ rm -f "$core_files"
ret=1
fi