File: rename.sh

package info (click to toggle)
eclipse 3.8.1-10
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 338,840 kB
  • ctags: 472,808
  • sloc: java: 2,762,042; ansic: 136,783; xml: 105,676; cpp: 35,759; jsp: 4,420; sh: 3,288; perl: 1,687; makefile: 232; python: 67; php: 24
file content (27 lines) | stat: -rwxr-xr-x 518 bytes parent folder | download | duplicates (3)
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/bash

baseArch=$1
newArch=$2

moves(){
for f in $(find -type d); do
      tofile=$(echo $f | sed "s/$baseArch/$newArch/")
      if [ $tofile != $f ]; then
        cp -pfr $f $tofile
      fi
    done
for f in $(find -type f); do
      tofile=$(echo $f | sed "s/$baseArch/$newArch/")
      if [ $tofile != $f ]; then
        cp -pfr $f $tofile
        rm -fr $f
      fi
    done
}

cd org.eclipse.equinox.launcher.gtk.linux.$newArch
    moves
cd ..
cd org.eclipse.core.filesystem.linux.$newArch
    moves
cd ..