~ubuntu-branches/debian/jessie/eso-midas/jessie

« back to all changes in this revision

Viewing changes to install/unix/copy.sh

  • Committer: Package Import Robot
  • Author(s): Ole Streicher
  • Date: 2014-04-22 14:44:58 UTC
  • Revision ID: package-import@ubuntu.com-20140422144458-okiwi1assxkkiz39
Tags: upstream-13.09pl1.2+dfsg
ImportĀ upstreamĀ versionĀ 13.09pl1.2+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh
 
2
# @(#)copy.sh   19.1 (ESO-IPG) 02/25/03 13:51:10
 
3
# .TYPE           command
 
4
# .NAME           copy.sh
 
5
# .LANGUAGE       shell script
 
6
# .ENVIRONMENT    Unix Systems. Executable under SHELL and C-SHELL
 
7
# .COMMENTS       Copy file in first argument ($1) to the local directory.
 
8
#                 If the file exists previously, then it is renamed.
 
9
# .AUTHOR         Carlos Guirao
 
10
# .VERSION 1.1    27-May-1988:          Implementation
 
11
 
 
12
if [ -d $1 ]; then
 
13
    if [ ! -d $MIDASHOME/$MIDVERS/local/$1 ]; then
 
14
        mkdir $MIDASHOME/$MIDVERS/local/$1
 
15
    fi
 
16
else
 
17
    if [ -f $MIDASHOME/$MIDVERS/local/$1 ]; then
 
18
        mv $MIDASHOME/$MIDVERS/local/$1  $MIDASHOME/$MIDVERS/local/${1}~
 
19
    fi
 
20
    cp $1  $MIDASHOME/$MIDVERS/local/$1
 
21
    chmod ug+rw $MIDASHOME/$MIDVERS/local/$1
 
22
fi