Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
AMBS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
esde
machine-learning
AMBS
Commits
2a6d4d03
Commit
2a6d4d03
authored
4 years ago
by
Michael Langguth
Browse files
Options
Downloads
Patches
Plain Diff
Echo-statements in convert_runscript.sh now similar to print-statements in Python routines.
parent
31b0c3b6
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
video_prediction_tools/config_runscripts/convert_runscript.sh
+11
-9
11 additions, 9 deletions
...o_prediction_tools/config_runscripts/convert_runscript.sh
with
11 additions
and
9 deletions
video_prediction_tools/config_runscripts/convert_runscript.sh
+
11
−
9
View file @
2a6d4d03
...
...
@@ -48,16 +48,18 @@ BASE_DIR=`pwd`
WORKING_DIR
=
"
$(
dirname
"
$BASE_DIR
"
)
"
EXE_DIR
=
"
$(
basename
"
$BASE_DIR
"
)
"
SCR_NAME
=
"convert_runscript.sh"
### Some sanity checks ###
# ensure that the script is executed from the env_setup-subdirectory
if
[[
"
${
EXE_DIR
}
"
!=
"config_runscripts"
]]
;
then
echo
"ERROR: Execute 'convert_runscript.sh' from the config_runscripts-subdirectory only!"
echo
"
%
${
SCR_NAME
}
:
ERROR: Execute 'convert_runscript.sh' from the config_runscripts-subdirectory only!"
exit
1
fi
# check input arguments
if
[[
"$#"
-ne
2
]]
;
then
echo
"ERROR: Pass path to workflow runscript (without '_template.sh') as well as name of target file"
echo
"Example: ./convert_runscript.sh ../HPC_scripts/DataExtraction ../HPC_scripts/DataExtraction_test.sh"
echo
"
%
${
SCR_NAME
}
:
ERROR: Pass path to workflow runscript (without '_template.sh') as well as name of target file"
echo
"
%
${
SCR_NAME
}
:
Example: ./convert_runscript.sh ../HPC_scripts/DataExtraction ../HPC_scripts/DataExtraction_test.sh"
exit
1
else
curr_script
=
$1
...
...
@@ -67,10 +69,10 @@ fi
# check existence of template script
if
!
[[
-f
${
curr_script
}
_template.sh
]]
;
then
echo
"WARNING: Could not find expected Batch script '
${
curr_script
}
_template.sh'."
echo
"Thus, no corresponding executable script is created!"
echo
"
%
${
SCR_NAME
}
:
WARNING: Could not find expected Batch script '
${
curr_script
}
_template.sh'."
echo
"
%
${
SCR_NAME
}
:
Thus, no corresponding executable script is created!"
if
[[
${
curr_script
}
==
*
"template"
*
||
${
curr_script
}
==
*
".sh"
*
]]
;
then
echo
"ERROR: Omit '_template' and/or '.sh' from Bash script argument."
echo
"
%
${
SCR_NAME
}
:
ERROR: Omit '_template' and/or '.sh' from Bash script argument."
exit
2
else
exit
0
# still ok, i.e. only a WARNING is raised
...
...
@@ -78,8 +80,8 @@ if ! [[ -f ${curr_script}_template.sh ]]; then
fi
# Check if target script is unique
echo
"Convert
${
curr_script
}
_template.sh to executable runscript"
echo
"The executable runscript is saved under
${
target_script
}
"
echo
"
%
${
SCR_NAME
}
:
Convert
${
curr_script
}
_template.sh to executable runscript"
echo
"
%
${
SCR_NAME
}
:
The executable runscript is saved under
${
target_script
}
"
### Do the work ###
# create copy of template which is modified subsequently
...
...
@@ -89,7 +91,7 @@ num_lines=`awk '/Template identifier/{ print NR }' ${target_script}`
line_s
=
`
echo
${
num_lines
}
|
cut
-d
' '
-f
1
`
line_e
=
`
echo
${
num_lines
}
|
cut
-d
' '
-f
2
`
if
[[
${
line_s
}
==
""
||
${
line_e
}
==
""
]]
;
then
echo
"ERROR:
${
curr_script
}
_template.sh exists, but does not seem to be a valid template script."
echo
"
%
${
SCR_NAME
}
ERROR:
${
curr_script
}
_template.sh exists, but does not seem to be a valid template script."
rm
${
target_script
}
# remove copy again
exit
3
else
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment