Skip to content

Instantly share code, notes, and snippets.

@ymendel
Created April 2, 2009 16:47
Show Gist options
  • Save ymendel/89279 to your computer and use it in GitHub Desktop.
Save ymendel/89279 to your computer and use it in GitHub Desktop.
lndir()
{
SRC_DIR=$1
TGT_LOC=${2:-.}
DIR_NAME=${SRC_DIR/%\//}
DIR_NAME=${DIR_NAME##*/}
mkdir $TGT_LOC/$DIR_NAME
for f in $SRC_DIR/* ; do
ln $f $TGT_LOC/$DIR_NAME/${f##*/}
done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment