diff --git a/scripts/linuxcnc.in b/scripts/linuxcnc.in index 49f9ed0eef3..9dc76e9be82 100644 --- a/scripts/linuxcnc.in +++ b/scripts/linuxcnc.in @@ -352,12 +352,13 @@ if [ -z "$INIFILE" ] ; then # nothing specified, get from the user # it returns either a path, or nothing at all INIFILE=$($PICKCONFIG) - # if name is xxxx.demo, then: - # execute xxxx.demo in background and exit - if [ "${INIFILE%%.demo}".demo = "${INIFILE}" ] ; then - "${INIFILE}" & - exit 0 - fi +fi + +# if name is xxxx.demo (picked now, or picked last time and reused with -l), +# then execute xxxx.demo in background and exit +if [ "${INIFILE%%.demo}".demo = "${INIFILE}" ] ; then + "${INIFILE}" & + exit 0 fi if [ -z "$INIFILE" ] ; then