我应该使用什么来等待 CSH 脚本中的命令完成?
我知道如果 bash 脚本 (sh) 应该等到链接脚本执行完毕,我必须写一个分号 ;在线的末尾。
这看起来像这样:
rm -rf /home/uwbe/uems/runs/$1/wrf_out/bow_derecho_index_750hpa/$2/* ;
rm -rf /home/uwbe/uems/runs/$1/wrf_out/ref_dbmax_1000/$2/* ;
rm -rf /home/uwbe/uems/runs/$1/wrf_out/ref_dbmax_3000/$2/* ;
但是我如何在 CSH 中执行此操作(在 .csh 脚本、Tcsh shell 中)?我可以在末尾加一个分号,但脚本不会等待而是继续。
有人给我提示吗?
我尝试在 csh 中的这些行末尾加一个分号。
I know that if a bash script (sh) should wait until the linked script has finished executing, that I have to write a semicolon ; at the end of the line.
This then looks something like this:
rm -rf /home/uwbe/uems/runs/$1/wrf_out/bow_derecho_index_750hpa/$2/* ;
rm -rf /home/uwbe/uems/runs/$1/wrf_out/ref_dbmax_1000/$2/* ;
rm -rf /home/uwbe/uems/runs/$1/wrf_out/ref_dbmax_3000/$2/* ;
But how do I do this in the CSH (in a .csh script, Tcsh shell) ? I can put a semicolon at the end, but the script doesn't wait but continues.
Does anyone have a tip for me?
I have try to put also a semicolon at the end of these lines in csh.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在 Tcsh 中,链接运算符以这种方式起作用:
因此您可以将所需的命令链接到一行。
另一种选择是使用要运行的命令创建一个文件,并在该文件上使用“source”命令。这将逐行执行命令(这通常发生在 .alias 文件上)-
In Tcsh the chaining operator acts in this way:
so you can chain the commands you need to one line.
Another option is to create a file with the commands you want to run , and use 'source' command on that file. This will execute the commands line by line (this usually happens on the .alias file) -