source:
utils/CI/sette/sette_use_LITE.sh
@
15320
Last change on this file since 15320 was 14981, checked in by acc, 3 years ago | |
---|---|
|
|
File size: 1.2 KB |
Line | |
---|---|
1 | #!/bin/bash |
2 | # set -vx |
3 | # Simple script to switch to using the reduced precision input files |
4 | # Finds all 4.2_RC strings in input*.cfg files and appends _LITE. |
5 | # Repeat with the -r flag to reverse this process. |
6 | # |
7 | # This needs to be run in the SETTE directory. |
8 | # |
9 | ######################################################################################### |
10 | ######################### Start of function definitions ################################# |
11 | ## |
12 | # |
13 | reverse=0 |
14 | if [ $# -gt 0 ]; then |
15 | while getopts r option; do |
16 | case $option in |
17 | r) reverse=1;; |
18 | h | *) echo '' |
19 | echo 'sette_use_LITE.sh : ' |
20 | echo ' Switch to using the reduced precision, LITE input files' |
21 | echo ' [-r] :' |
22 | echo ' Switch back to using the normal 4.2_RC files' |
23 | exit 42;; |
24 | esac |
25 | done |
26 | shift $((OPTIND - 1)) |
27 | fi |
28 | # |
29 | if [ $reverse == 0 ] ; then |
30 | for file in $( grep -l -e '4.2_RC\.' -e '4.2_RC$' in*cfg ) |
31 | do |
32 | perl -0777 -pi -e 's@4.2_RC@4.2_RC_LITE@g' $file |
33 | done |
34 | else |
35 | for file in $( grep -l -e '4.2_RC_LITE\.' -e '4.2_RC_LITE$' in*cfg ) |
36 | do |
37 | perl -0777 -pi -e 's@4.2_RC_LITE@4.2_RC@g' $file |
38 | done |
39 | fi |
40 | # |
41 | exit |
Note: See TracBrowser
for help on using the repository browser.