Ubuntu使用ssh远程打开terminal执行脚本

gui-launcher

#!/bin/bash -e
# NAME: gui-launcher
# Check whether the user is logged-in
while [ -z "$(pgrep gnome-session -n -U $UID)" ]; do sleep 3; done
# Export the current desktop session environment variables
export $(xargs -0 -a "/proc/$(pgrep gnome-session -n -U $UID)/environ")
# Execute the input command
#nohup "$@" >/dev/null 2>&1 &
source "$@"
exit 0

remote_start.sh

terminator -x  bash -c "/home/u1/startup.sh"

ssh命令

ssh [email protected] "/home/u1/gui-launcher remote_start.sh"

你可能感兴趣的:(Ubuntu使用ssh远程打开terminal执行脚本)