在指定的命令之后有没有一种方法可以运行命令

时间:2020-03-26 15:02:24

标签: shell unix zsh

在我运行单独的命令后,我试图找到一种运行简单的echo命令的方法。

在这种情况下,我试图运行类似的命令 echo 'dont forget to add the newly created app to settings' 我跑完之后 python manage.py createapp newAppName

1 个答案:

答案 0 :(得分:1)

如果您在另一条语句之后写一条语句,那自然就会发生。在脚本中,输入:

python manage.py createapp newAppName
echo 'dont forget to add the newly created app to settings'

如果以交互方式键入命令,则可能需要将它们放在一行上。使用;

python manage.py createapp newAppName; echo 'dont forget to add the newly created app to settings'

或者如果&&成功,则使用echo仅运行manage.py

python manage.py createapp newAppName && echo 'dont forget to add the newly created app to settings'
相关问题