Skip to content
Snippets Groups Projects
Commit dc81c2c4 authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

Merge branch '7000-corrections' into 'master'

fix: get filename from select with single value

See merge request !132
parents 20c1d1a2 d51efb55
Branches
No related tags found
1 merge request!132fix: get filename from select with single value
...@@ -569,13 +569,14 @@ EOH ...@@ -569,13 +569,14 @@ EOH
# if there is a single dump in backup folder: # if there is a single dump in backup folder:
# '-rw-r--r-- 1 root root 481 Mar 13 12:27 ahcrawler__20240313-1227.sql.gz' # '-rw-r--r-- 1 root root 481 Mar 13 12:27 ahcrawler__20240313-1227.sql.gz'
# --> take the last part behind the last space to get a filename # --> take the last part behind the last space to get a filename
grep "^-[rwxsSt\-]* " <<< "$LASTINPUT" && dbfile="$(rev <<< \'"$LASTINPUT"\' | cut -d ' ' -f 1 | rev)" grep "[rwxsSt\-]{10,} " <<< "$LASTINPUT" \
&& dbfile="$(rev <<< \'"$LASTINPUT"\' | cut -d ' ' -f 1 | rev)"
echo echo
sTargetDb=$(guessDB ${dbfile}) sTargetDb=$(guessDB ${dbfile})
color.print input "New database name [$sTargetDb] >" color.print input "New database name [$sTargetDb] >"
read -r sTargetDb read -r sTargetDb
if [ -z $sTargetDb ]; then if [ -z "$sTargetDb" ]; then
sTargetDb=$(guessDB ${dbfile}) sTargetDb=$(guessDB ${dbfile})
fi fi
echo echo
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment