Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mkexp
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Package Registry
Operate
Terraform modules
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
esmenv
mkexp
Commits
07d62f23
Commit
07d62f23
authored
4 years ago
by
Karl-Hermann Wieners
Browse files
Options
Downloads
Patches
Plain Diff
Global: Added dry run option (-n) to 'cpexp'
parent
d90c4e9b
No related branches found
No related tags found
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
CHANGES.txt
+1
-0
1 addition, 0 deletions
CHANGES.txt
cpexp
+10
-3
10 additions, 3 deletions
cpexp
cppath
+13
-4
13 additions, 4 deletions
cppath
doc/mkexp.fodt.in
+712
-706
712 additions, 706 deletions
doc/mkexp.fodt.in
doc/mkexp.pdf
+0
-0
0 additions, 0 deletions
doc/mkexp.pdf
with
736 additions
and
713 deletions
CHANGES.txt
+
1
−
0
View file @
07d62f23
...
...
@@ -15,6 +15,7 @@ Global
* Changed version info to be retrieved from version control system.
This requires an additional 'make' step before running
* Changed 'setconfig' to take additional config files to merged with the first
* Added dry run option (-n) to 'cpexp'
Configuration
-------------
...
...
This diff is collapsed.
Click to expand it.
cpexp
+
10
−
3
View file @
07d62f23
...
...
@@ -14,8 +14,15 @@ die () {
exit
1
}
CPPATHFLAGS
=
if
[
"x
$1
"
=
x-n
]
then
CPPATHFLAGS
=
-n
shift
fi
[
"x
$2
"
=
x
]
&&
die
"Oops: invalid number of parameters
Usage:
$PROGRAM
config_file new_exp_id [key=value...]"
Usage:
$PROGRAM
[-n]
config_file new_exp_id [key=value...]"
CONFIG_A
=
$1
EXP_B
=
$2
...
...
@@ -25,8 +32,8 @@ eval `getexp -v "$CONFIG_A" "$@" || echo '
'
exit
$?
`
EXP_A
=
$EXP_ID
set
$SCRIPT_DIR
$WORK_DIR
$RESTART_DIR
$DATA_DIR
$LOG_DIR
$MON_DIR
/
$EXP_A
### $MON_DIR/index.html
set
$SCRIPT_DIR
$WORK_DIR
$RESTART_DIR
$DATA_DIR
$LOG_DIR
$
{
MON_DIR
}${
MON_DIR
:+
/
$EXP_A
}
### $MON_DIR/index.html
for
PATH_A
do
cppath
"
$EXP_A
"
"
$EXP_B
"
"
$PATH_A
"
cppath
$CPPATHFLAGS
"
$EXP_A
"
"
$EXP_B
"
"
$PATH_A
"
done
This diff is collapsed.
Click to expand it.
cppath
+
13
−
4
View file @
07d62f23
...
...
@@ -6,6 +6,8 @@
#
PROGRAM
=
`
basename
$0
`
BINDIR
=
`
dirname
$0
`
PATH
=
"
$BINDIR
:
$PATH
"
die
()
{
echo
"
$@
"
>
&2
...
...
@@ -33,8 +35,15 @@ cp_exp_file () {
esac
}
EXEC
=
if
[
"x
$1
"
=
x-n
]
then
EXEC
=
echo
shift
fi
[
"x
$3
"
=
x
]
&&
die
"Oops: invalid number of parameters
Usage:
$PROGRAM
experiment_id_a experiment_id_b path_to_a [path_to_b]"
Usage:
$PROGRAM
[-n]
experiment_id_a experiment_id_b path_to_a [path_to_b]"
unset
CDPATH
...
...
@@ -53,7 +62,7 @@ else
PATH_B
=
$(
dirname
$PATH_B
)
fi
mkdir
-vp
"
$PATH_B
"
$EXEC
mkdir
-vp
"
$PATH_B
"
for
DIR_A
in
$(
{
...
...
@@ -63,7 +72,7 @@ for DIR_A in $(
)
do
DIR_B
=
`
echo
"
$DIR_A
"
|
sed
"s,
$EXP_A
,
$EXP_B
,g"
`
mkdir
-vp
"
$PATH_B
"
/
"
$DIR_B
"
$EXEC
mkdir
-vp
"
$PATH_B
"
/
"
$DIR_B
"
done
for
FILE_A
in
$(
...
...
@@ -74,7 +83,7 @@ for FILE_A in $(
)
do
FILE_B
=
${
FIND_B
:-
$(
echo
"
$FILE_A
"
|
sed
"s,
$EXP_A
,
$EXP_B
,g"
)
}
cp_exp_file
"
$EXP_A
"
"
$EXP_B
"
"
$PATH_A
/
$FILE_A
"
"
$PATH_B
/
$FILE_B
"
||
$EXEC
cp_exp_file
"
$EXP_A
"
"
$EXP_B
"
"
$PATH_A
/
$FILE_A
"
"
$PATH_B
/
$FILE_B
"
||
STATUS
=
$?
done
...
...
This diff is collapsed.
Click to expand it.
doc/mkexp.fodt.in
+
712
−
706
View file @
07d62f23
Source diff could not be displayed: it is too large. Options to address this:
view the blob
.
This diff is collapsed.
Click to expand it.
doc/mkexp.pdf
+
0
−
0
View file @
07d62f23
No preview for this file type
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