Skip to content
Snippets Groups Projects
Commit b3a25bb2 authored by Beat Küng's avatar Beat Küng Committed by Daniel Agar
Browse files

posix rcS: use sed instead of grep -P

The -P argument seems not to be supported on OSX
parent 18ccf8db
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment