From b3a25bb2bbb750dec353fe7a843ddd1c94ed3897 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beat=20K=C3=BCng?= Date: Wed, 15 Aug 2018 11:02:22 +0200 Subject: [PATCH] posix rcS: use sed instead of grep -P The -P argument seems not to be supported on OSX --- ROMFS/px4fmu_common/init.d-posix/rcS | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ROMFS/px4fmu_common/init.d-posix/rcS b/ROMFS/px4fmu_common/init.d-posix/rcS index 804b059fcb..91c9cb7c8f 100644 --- a/ROMFS/px4fmu_common/init.d-posix/rcS +++ b/ROMFS/px4fmu_common/init.d-posix/rcS @@ -40,8 +40,8 @@ if [ "$PX4_SIM_MODEL" == "shell" ]; then set RUN_MINIMAL_SHELL yes else # Find the matching Autostart ID (file name has the form: [0-9]+_${PX4_SIM_MODEL}) - # shellcheck disable=SC2010 #(the file names don't contain spaces) - REQUESTED_AUTOSTART=$(ls "$SCRIPT_DIR" | grep -oP '^[0-9]+(?=_'${PX4_SIM_MODEL}'$)') + # shellcheck disable=SC2012 #(the file names don't contain spaces) + REQUESTED_AUTOSTART=$(ls "$SCRIPT_DIR" | sed -n 's/^\([0-9][0-9]*\)_'${PX4_SIM_MODEL}'$/\1/p') if [ -z "$REQUESTED_AUTOSTART" ]; then echo "Error: Unknown model '$PX4_SIM_MODEL'" exit -1