function linkup() { local component=$1 shift #do core for rk in $*; do if [ ! -e "../$rk/$component" ]; then ln -s "../shared/$component" "../$rk" fi done } #check they all exist first for rk in lirk2 lirk3 wirk2 wirk3 mark2 mark3 sork2 sork3 derk cdrk2; do if [ ! -d "../$rk" ]; then echo "$rk not present" some_not_present=true fi done if [ "$some_not_present" == "true" ]; then exit fi linkup core lirk2 lirk3 wirk2 wirk3 mark2 mark3 sork2 sork3 derk cdrk2 linkup greenstone2 lirk2 wirk2 mark2 sork2 cdrk2 linkup greenstone3 lirk3 wirk3 mark3 sork3 linkup linux lirk2 lirk3 mark2 mark3 sork2 sork3 derk cdrk2 linkup windows wirk2 wirk3 sork2 sork3 cdrk2 linkup mac mark2 mark3