Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OSUG
RESIF
datadump
Commits
cf2d1261
Commit
cf2d1261
authored
Jul 17, 2020
by
Jonathan Schaeffer
Browse files
Correction de la regex
parent
e5a88891
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/test_restore_from_metadata.sh
View file @
cf2d1261
...
...
@@ -83,7 +83,7 @@ function test_random_file {
target_file_date
=
$(
date
+%s
-d
$(
stat
$target_file
--print
%z |
awk
'{print $1}'
))
fname
=
$(
echo
$target_file
|
awk
-F
'/'
'{print $NF}'
)
echo
$fname
regex
=
"([A-Z0-9]+)
\.
([A-Z]+)
\.
[0-9]*
\.
([A-Z0-9]{3}
\.
D)
\.
([12][0-9]{3})
\.
[0-3][0-9]{2}"
regex
=
"([A-Z0-9]+)
\.
([A-Z]+)
\.
[
A-Z
0-9]*
\.
([A-Z0-9]{3}
\.
D)
\.
([12][0-9]{3})
\.
[0-3][0-9]{2}"
archive_file
=
""
if
[[
$fname
=
~
$regex
]]
;
then
archive_file
=
"
$archivedir
/
${
BASH_REMATCH
[4]
}
/
${
BASH_REMATCH
[1]
}
/
${
BASH_REMATCH
[2]
}
/
${
BASH_REMATCH
[3]
}
/
$fname
"
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment