【发布时间】:2015-08-02 12:50:49
【问题描述】:
我打算使用文件顺序运行 unix 命令。 这些命令包括运行 perl 脚本。
【问题讨论】:
-
shell 脚本不行吗?
-
如果你不得不问这个问题,那么我认为你已经超出了你的深度......
我打算使用文件顺序运行 unix 命令。 这些命令包括运行 perl 脚本。
【问题讨论】:
您正在寻找的是一个 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
【讨论】: