File: cpfiles.bash

package info (click to toggle)
splash 2.5.0-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 8,192 kB
  • ctags: 3,886
  • sloc: f90: 46,438; ansic: 11,453; makefile: 891; lex: 823; perl: 535; sh: 194
file content (36 lines) | stat: -rwxr-xr-x 933 bytes parent folder | download | duplicates (2)
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; 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