- Test m_pkthdr.fw_flags against DUMMYNET_MBUF_TAGGED before trying to locate
[dragonfly/netmp.git] / contrib / top / install
blobd8b6283eaca1f78a9b9a09003c46fac98513588b
1 #!/bin/sh
3 # this shell script is amazingly similar to the old and lamented
4 # BSD "install" command. It recognized the following options:
6 # -o target file owner
7 # -m target file mode
8 # -g target file group owner
11 # scan the options
13 while [ $# -gt 0 ]; do
14 case $1 in
15 -o)
16 owner=$2
17 shift ; shift
20 -m)
21 mode=$2
22 shift; shift
25 -g)
26 group=$2
27 shift ; shift
30 -*)
31 echo "install: unknown option $1"
32 exit
36 break
38 esac
39 done
41 # we need two more: filename and destination
43 if [ $# -ne 2 ]; then
44 echo "Usage: install [ -o owner ] [ -m mode ] [ -g group ] file destination"
45 exit
48 # first, copy
50 cp $1 $2
52 # normalize the name
54 dest=$2
55 if [ -d $2 ]; then
56 dest=$2/`basename $1`
59 # do optional things
61 if [ "$owner" ]; then
62 chown $owner $dest
64 if [ "$group" ]; then
65 chgrp $group $dest
67 if [ "$mode" ]; then
68 chmod $mode $dest