Debian Codegraph @

07p/cmds/@mv

raw symbols ◀ ▶ SCIP
1 Debian patch touch this file
1 #!/bin/shscip-shell filesystem . . `/bin/sh`.
2 error="true"
3 name1="$1"
4 name2="$2"
5 dir1=""
6 dir2=""
7 if testscip-shell system . . test. -d "$1"; then
8 dir1="$1/"
9 name1="$2"
10 if testscip-shell system . . test. $# -eq 4; then
11 dir2="$3/"
12 name2="$4"
13 elif testscip-shell system . . test. $# -eq 3; then
14 name2="$3"
15 fi
16 elif testscip-shell system . . test. -d "$2"; then
17 dir2="$2/"
18 if testscip-shell system . . test. $# -eq 3; then
19 file2="$3"
20 else
21 file2="$1"
22 fi
23 fi
24 for prefix in b s d c; do
25 file1="$dir1$prefix.$name1"
26 file2="$dir2$prefix.$name2"
•27 if testscip-shell system . . test. $prefix = "c"; then
28 if cpscip-shell system . . cp. -f "$file1" "$file2" 2> /dev/nullscip-shell filesystem . . `/dev/null`.; then
29 echoscip-shell system . . echo. "Copying $file1 to $file2 ... done"
30 unset error
31 fi
32 elif mvscip-shell system . . mv. -f "$file1" "$file2" 2> /dev/nullscip-shell filesystem . . `/dev/null`.; then
33 echoscip-shell system . . echo. "Renaming $file1 as $file2 ... done"
34 unset error
35 fi
36 done
37 if testscip-shell system . . test. -n "$error"; then
38 echoscip-shell system . . echo. "Renaming: no files found for $dir1[bsdc].$name1 and $dir2[bsdc].$name2"
39 fi