File: doc_fix

package info (click to toggle)
apache 1.3.34-4.1%2Betch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 4,824 kB
  • ctags: 90
  • sloc: sh: 1,273; makefile: 686; perl: 215
file content (20 lines) | stat: -rw-r--r-- 340 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
#!/bin/bash

cd $1

for i in `find . -name "*.html.html"`; do

	# we strip ./ in the beginning and .html at the end
	noextra=`echo $i | sed -e 's/^.\///g' -e 's/.html$//g'`

	# in which dir is
	dir=`dirname $noextra`

	# and the real file name
	file=`basename $noextra`

	# creating the symlink
	cd $dir
	ln -sf $file.html $file
	cd -
done