#!/bin/sh
computer=`echo $0|cut -d'/' -f5`
if [ -z $1 ];then
echo Please input cmd to run in
echo -e '\e[40;33;1m'$computer'\e[0m' computer or press
echo -e '\e[240;32;1m'ENTER'\e[0m' to login.
read cmd
if [ -z $cmd ];then
ssh
else
ssh "hostname;$cmd"
fi
echo .
else
echo now exec $1 in $computer
ssh "hostname;$1"
echo .
echo command exec ok!!
fi
阅读(720) | 评论(0) | 转发(0) |