#!/bin/bash
#move folder or file
remote=ywang@morbier.cmla.ens-cachan.fr:/home/ywang
remote=ywang@morbier.cmla.ens-cachan.fr:/home/ywang/vjsel
#remote=yiqing@purple:/home/yiqing
echo "interact with remote $remote"
#read -p "to or from remote purple : " answer
if [[ $1 == *.flo ]]
then 
	answer=f
elif [[ $1 == *.tgz ]]
then
	answer=t
else
	answer=t
fi
#to remove machine
if [[ $answer == t ]]
then
		#directory
	if [[ $1 == -r ]]
	then
		scp $1 $2 $remote/.
	else	#file
		scp $1 $remote/.
	fi
else
	if [[ $1 == -r ]]
	then
		scp $1 $remote/$2 .
	else
		scp $remote/$1 .
	fi
fi

if [[ $1 == *.png ]]
then
	eog $1
fi






