File: make-links

package info (click to toggle)
cssc 1.4.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 11,368 kB
  • sloc: cpp: 39,446; ansic: 17,403; sh: 11,328; python: 3,923; makefile: 1,929; perl: 342; awk: 15; sed: 15
file content (29 lines) | stat: -rw-r--r-- 363 bytes parent folder | download | duplicates (4)
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
28
29
#!/bin/sh

if [ $# -gt 0 ]
then
	srcdir=$1
else
	srcdir=.
fi

common_files=`ls ${srcdir}/common` 
#echo "common files = " ${common_files}


for d in * 
do 
	if test -d "$d" && ! test "$d" = common
	then 
		for i in ${common_files}
		do 
			case $i in 
			*~) 
			;;
			*) 
			( cd $d; rm -f $i; ln -s ../${srcdir}/common/$i $i ) 
			;;
			esac
		done 
	fi 
done