provided extension for sed backups (#35)
* provided extension for sed backups * Use ./*glob* in rm so names with dashes won't become options
This commit is contained in:
parent
55b8b9a896
commit
1f9a0ea7c8
3
flash
3
flash
|
|
@ -332,7 +332,8 @@ ${LGREY}Select a number to continue, or${NC} ${LRED}Q${NC} ${LGREY}to quit...${N
|
||||||
## Remove forward slashes in the Questions and answers
|
## Remove forward slashes in the Questions and answers
|
||||||
QUESTION_REGEX=$(sed "s/\(\/\|\[\|\]\|\*\)/\\\\\1/g" <<<"${q[1]}")
|
QUESTION_REGEX=$(sed "s/\(\/\|\[\|\]\|\*\)/\\\\\1/g" <<<"${q[1]}")
|
||||||
ANSWER_REGEX=$(sed "s/\(\/\|\[\|\]\|\*\)/\\\\\1/g" <<<"${q[2]}")
|
ANSWER_REGEX=$(sed "s/\(\/\|\[\|\]\|\*\)/\\\\\1/g" <<<"${q[2]}")
|
||||||
sed -i "s/${q[0]}:$QUESTION_REGEX:$ANSWER_REGEX:${q[3]}/${q[0]}:$QUESTION_REGEX:$ANSWER_REGEX:$NEW_ITEM_SCORE/g" "$DECK"
|
sed -i .bak "s/${q[0]}:$QUESTION_REGEX:$ANSWER_REGEX:${q[3]}/${q[0]}:$QUESTION_REGEX:$ANSWER_REGEX:$NEW_ITEM_SCORE/g" "$DECK"
|
||||||
|
rm ./*.bak
|
||||||
# If no highscore currently set, set it.
|
# If no highscore currently set, set it.
|
||||||
[ -z "$(cat "$HIGH_SCORE")" ] && echo "$COUNTER" >"$HIGH_SCORE"
|
[ -z "$(cat "$HIGH_SCORE")" ] && echo "$COUNTER" >"$HIGH_SCORE"
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue