File: cpfiles.sh

package info (click to toggle)
splash 3.11.6-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,068 kB
  • sloc: f90: 55,119; ansic: 2,435; python: 828; makefile: 601; cpp: 529; perl: 219; sh: 152
file content (36 lines) | stat: -rwxr-xr-x 946 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
#
# short script to copy all splash
# files to a new prefix
#
# ie. splash.defaults, splash.limits, splash.units etc.
# become new.defaults, new.limits, new.units
#
# SPLASH can be invoked to use the new settings files
# using the -p command line option
#
if [ $# -lt 1 ] || [ $# -gt 2 ]; then
   echo 'SPLASH files copy utility -- '
   echo 'copies splash.defaults, splash.limits etc. '
   echo '    to new.defaults, new.limits etc. (use with splash -p new)'
   echo
   echo "Usage $0 newprefix [oldprefix]";
   echo
   echo '(default old prefix is "splash")';
   exit;
else
   new=$1;
   if [ $# -eq 2 ]; then
      old=$2;
   else
      old='splash';
   fi
   for ext in defaults limits units titles anim legend columns filenames func spirals; do
       if [ -e $old.$ext ]; then
          cp $old.$ext $new.$ext;
          echo "$old.$ext -> $new.$ext";
       else
          echo "$old.$ext does not exist";
       fi
   done
fi