【问题标题】:Running Unix Commands sequentially using a file [closed]使用文件顺序运行 Unix 命令 [关闭]
【发布时间】:2015-08-02 12:50:49
【问题描述】:

我打算使用文件顺序运行 unix 命令。 这些命令包括运行 perl 脚本。

【问题讨论】:

  • shell 脚本不行吗?
  • 如果你不得不问这个问题,那么我认为你已经超出了你的深度......

标签: perl unix command


【解决方案1】:

您正在寻找的是一个 bash 脚本。

#!/bin/bash
echo "my bash script"
mkdir "tmp"
perl my_perl_script.pl

将此保存到文件script.sh

你现在可以运行它了

bash script.sh

或者你可以像普通的可执行文件一样运行它:

chmod a+x script.sh # set script as executable
./script.sh

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-10-29
    • 2011-09-15
    • 2016-05-18
    • 2013-09-05
    • 2015-08-31
    • 2019-11-06
    相关资源
    最近更新 更多