File tree Expand file tree Collapse file tree 4 files changed +55
-0
lines changed Expand file tree Collapse file tree 4 files changed +55
-0
lines changed Original file line number Diff line number Diff line change
1
+ Package: xcopy
2
+ Version: 0.20151118
3
+ Architecture: all
4
+ Maintainer: zvezdochiot <
[email protected] >
5
+ Section: utils
6
+ Priority: optional
7
+ Installed-Size: 12
8
+ Depends: coreutils, findutils, cpio
9
+ Homepage: http://mykaralw.narod.ru/
10
+ Description: Bash-script for xcopy.
11
+ Bash-script for copy dir as sort structure.
Original file line number Diff line number Diff line change
1
+ 487cc27634e09ac08d44804196bf3989 usr/share/scripts/bash/xcopy.sh
Original file line number Diff line number Diff line change
1
+ ../share/scripts/bash/xcopy.sh
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ # xcopy.sh
4
+ # 2015-11-18
5
+
6
+ tdir=` pwd` ;
7
+ srcdir=" $1 " ;
8
+ dstdir=" $2 " ;
9
+ flgcp=" $3 " ;
10
+
11
+ if [ " x$srcdir " = " x" -o " x$dstdir " = " x" ]
12
+ then
13
+ echo " Usage:"
14
+ echo " $0 srcdir destdir [nc|ln]"
15
+ exit 0
16
+ fi
17
+
18
+ if [ ! -d " $srcdir " ]
19
+ then
20
+ echo " Not find source $srcdir !"
21
+ exit 1
22
+ fi
23
+
24
+ if [ ! -d " $dstdir " ]
25
+ then
26
+ mkdir -pv " $dstdir "
27
+ fi
28
+
29
+ # tree dirs
30
+ find " $srcdir " -xtype d | sort | cpio -padv " $dstdir " ;
31
+
32
+ # copy file
33
+ if [ " x$flgcp " = " x" ]
34
+ then
35
+ find " $srcdir " -xtype f | sort | cpio -padv " $dstdir " ;
36
+ elif [ " x$flgcp " = " xln" ]
37
+ then
38
+ find " $srcdir " -xtype f -printf " %p\n" | sort | while read tfile
39
+ do
40
+ ln -fv " $tfile " " $dstdir /$tfile "
41
+ done
42
+ fi
You can’t perform that action at this time.
0 commit comments