File: mklinks

package info (click to toggle)
xntp3 5.93-2
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 7,644 kB
  • ctags: 7,419
  • sloc: ansic: 59,474; perl: 3,633; sh: 2,623; awk: 417; makefile: 311; asm: 37
file content (9 lines) | stat: -rwxr-xr-x 359 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
#!/bin/sh
# call from the source root as 'mklinks ../sun4 ../src'
find . -type d -print | sort | sed -e "s#^\.#mkdir $1#" | sh
root=`echo $2 | sed -e "s#^\.\./##"`
find . ! -type d -a ! -name Config -print | sed -e "s#^\./##" | while read file
	do
		down="`echo $file | sed -e 's#[^/]*/#../#g' -e 's#[^/]*$#..#'`"
		ln -s "$down/$root/$file" "$1/$file"
	done