简体   繁体   中英

Bash Scripting: terminal and multiple other actions

Let's say I'm accessing the terminal and performing an ssh command from a bash script. I'd also like to, after I've opened the ssh, perform a few more things like:

  1. cd /srv/django
  2. python manage.py shell
  3. execfile 'home/usr/myscript.py'

My script file so far:

#!/bin/bash

ssh server "python /srv/django/manage.py shell" execfile 'home/usr/myscript.py' 

How could I go about performing this through the script?

ssh在其命令行末尾接受远程系统的命令,例如:

xterm -e ssh servercomp cd /srv/django \; python manage.py shell

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM