| 1 |
#!/bin/bash |
| 2 |
# |
| 3 |
# short script to copy all splash |
| 4 |
# files to a new prefix |
| 5 |
# |
| 6 |
# ie. splash.defaults, splash.limits, splash.units etc. |
| 7 |
# become new.defaults, new.limits, new.units |
| 8 |
# |
| 9 |
# SPLASH can be invoked to use the new settings files |
| 10 |
# using the -p command line option |
| 11 |
# |
| 12 |
if [ $# -lt 1 ] || [ $# -gt 2 ]; then |
| 13 |
echo 'SPLASH files copy utility -- ' |
| 14 |
echo 'copies splash.defaults, splash.limits etc. ' |
| 15 |
echo ' to new.defaults, new.limits etc. (use with splash -p new)' |
| 16 |
echo |
| 17 |
echo "Usage $0 newprefix [oldprefix]"; |
| 18 |
echo |
| 19 |
echo '(default old prefix is "splash")'; |
| 20 |
exit; |
| 21 |
else |
| 22 |
new=$1; |
| 23 |
if [ $# -eq 2 ]; then |
| 24 |
old=$2; |
| 25 |
else |
| 26 |
old='splash'; |
| 27 |
fi |
| 28 |
for ext in defaults limits units titles anim legend columns filenames func spirals; do |
| 29 |
if [ -e $old.$ext ]; then |
| 30 |
cp $old.$ext $new.$ext; |
| 31 |
echo "$old.$ext -> $new.$ext"; |
| 32 |
else |
| 33 |
echo "$old.$ext does not exist"; |
| 34 |
fi |
| 35 |
done |
| 36 |
fi |