#! /bin/csh -f # Last modified on Mon Dec 14 19:03:49 1987 by stolfi #================================================== # Usage: putlink name [name...] dir is almost the same as # as ln -s name dir/name, but requres # last name to be a directory, and doesn't complain # if the links already exist. #================================================== @ n = $#argv if ( ( $n < 1 ) || ( ! ( -d $argv[$n] ) ) ) then echo "usage: $0 [name ...] directory" endif set dir = $argv[$n] @ nminus = $n - 1 foreach f ( $argv[1-$nminus] ) set realf = `expandpath $f` if ( -d $dir/$f:t ) then echo "error --- $dir/$f exists and is a directory." else echo "Installing link $dir/$f:t "'->'" $realf" rm -f $dir/$f:t ln -s $realf $dir/$f:t endif end # foreach f ( $argv[1-$nminus] ) # ls -l $dir/$f:t # end