File: removedups.sh

package info (click to toggle)
geda-doc 1%3A1.4.0-2
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 5,344 kB
  • ctags: 1,363
  • sloc: sh: 742; makefile: 145
file content (22 lines) | stat: -rwxr-xr-x 325 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh

prefix=$1

cd _media
files=`ls -1 ${prefix}*`

cd ../_detail

for i in $files
do
	oldname=$i
	newname=`echo $i | sed "s/$prefix//g"`
	htmlfiles=`grep -l $oldname *.html`
	for j in $htmlfiles
	do
		echo Patching $j : $oldname to $newname
		mv $j $j.orig
		cat $j.orig | sed "s/$oldname/$newname/g" > $j
	done
done