一个脚本中的两个命令 ubuntu 终端

Two commands in one script ubuntu terminal

我有两个命令:

#!/bin/bash

python /srv/django/manage.py shell; execfile('/home/usr/myscript.py')

我想在一个脚本中使用它们 scr.sh。然而,事实上,我得到了错误。

CommandError: Command doesn't accept any arguments
/home/usr/project.sh: line 7: syntax error near unexpected token `'/home/usr/myscript.py''

其中 myscript.py 是我想要的代码 运行 当 python shell 出现时。我怎样才能实现这一目标?

谢谢!

这里发生的是';'符号将等到 shell 中的内容为 performed/run。正确的语法是

#!/bin/bash

python /srv/django/manage.py shell <<EOF\ execfile('myscript.py') EOF