You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
309 B
15 lines
309 B
#!/usr/bin/env sh
|
|
|
|
userAtAddress="$1"
|
|
USER=$(echo "$userAtAddress" | cut -d"@" -f1);
|
|
HOST=$(echo "$userAtAddress" | cut -d"@" -f2);
|
|
|
|
if [ "$USER" = "$HOST" ]
|
|
then
|
|
printf "Enter your username: "
|
|
read -r USER
|
|
USER=$(echo "${USER}" | tr -d '[:space:]')
|
|
ssh "$USER"@"$HOST"
|
|
else
|
|
ssh "$userAtAddress"
|
|
fi
|
|
|