File: install

package info (click to toggle)
pari 2.17.3-1
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 24,508 kB
  • sloc: ansic: 281,184; sh: 861; perl: 420; yacc: 214; makefile: 162; f90: 88
file content (27 lines) | stat: -rwxr-xr-x 384 bytes parent folder | download | duplicates (12)
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
#! /bin/sh

mode=755
while test $# -gt 0; do
  case "$1" in
  -c);;
  -m) shift; mode="$1";;
  *) break;;
  esac
  shift
done

if test -d "$2"; then
  file="$2/`basename "$1"`"
else
  file="$2"
fi

if test -d "$1"; then
  mkdir -p "$file"
  for f in `ls "$1"`; do
    "$0" -m "$mode" "$1/$f" "$file"
  done
else
  cp "$1" "$2";
  if test -f "$file"; then chmod "$mode" "$file"; fi
fi