#!/bin/sh
# 链接选择的文件或者目录到指定目录中（可多个一起链接）
#fpoint于2009年11月12日
DESTINO=$(zenity --title "要链接到哪里去？－fpoint" --file-selection --directory)
for FileOrDir 
do
	if [ -L "$DESTINO/$FileOrDir" ];	then
		zenity --info --text="链接‘$FileOrDir’已经存在，不能建立链接！" --title "重复提醒"
	elif [ -d "$DESTINO/$FileOrDir" ];	then
		zenity --info --text="目录‘$FileOrDir’已经存在，不能建立链接！" --title "重复提醒"
	elif [ -f "$DESTINO/$FileOrDir" ];	then
		zenity --info --text="文件‘$FileOrDir’已经存在，不能建立链接！" --title "重复提醒"
	else
		ln -s "$PWD/$FileOrDir" "$DESTINO"
	fi
done
