quote rom names with single quotes

Signed-off-by: Michel-FK <michel.stempin@funkey-project.com>
This commit is contained in:
Michel-FK 2021-06-09 23:35:34 +02:00
parent bfed99494e
commit ff83118833
1 changed files with 8 additions and 4 deletions

View File

@ -60,11 +60,15 @@ save)
# Write quick load file args
echo -n "" > "${INSTANT_PLAY_FILE}"
for arg in "$@"; do
# Add quotes around all arguments
echo -n "'${arg}' " >> "${INSTANT_PLAY_FILE}"
while :
do
printf "'" >> "${INSTANT_PLAY_FILE}"
printf %s "$1" | sed "s/'/'\\\\''/g" >> "${INSTANT_PLAY_FILE}"
shift
case $# in 0) break; esac
printf "' " >> "${INSTANT_PLAY_FILE}"
done
printf "'\n" >> "${INSTANT_PLAY_FILE}"
# Add the magic sauce to launch the process in background,
# record the PID into a file, wait for the process to