我是新来的。请帮帮忙。
每当我需要测试和刷新数据库表时,我已经多次连续运行4个命令。
我已经运行了4个命令(为了表达这个想法而缩短)来重置2个表:
aws dynamodb delete-table --tableName TableA
aws dynamodb delete-table --tableName TableB
aws dynamodb create-table --tableName TableA attributeSettingsBlaBlaA
aws dynamodb create-table --tableName TableB attributeSettingsBlaBlaB有没有办法让我把这4个命令放在一个脚本中,这样当我在MAC终端上运行./combined_script时,请帮我运行这4个命令?
我做了一些研究,但&&也需要一些复制粘贴工作。请教CS的方式和帮助。谢谢。
抱歉我没说清楚。重新编辑。谢谢大家的帮助。
发布于 2016-11-21 20:06:26
你指的是苹果MAC吗?不管怎样,这个应该还能用
#!/bin/sh
delete-table --tableName TableA
delete-table --tableName TableB
create-table --tableName TableA attributeSettingsBlaBlaA
create-table --tableName TableB attributeSettingsBlaBlaB将其保存到一个文件中,例如combined_script或任何您喜欢的文件,并确保它可执行。
chmod +x ./combined_script那它应该做你想做的事。希望这能帮上忙!
https://askubuntu.com/questions/852054
复制相似问题