我们可以在 perl 脚本中获取 shell 脚本吗?
示例: 方案 1:
cat test1.sh
#!/bin/ksh
DATE=/bin/date
Run Code Online (Sandbox Code Playgroud)
方案2:
cat test2.sh
#!/bin/ksh
. ./test1.sh
echo `$DATE`
Run Code Online (Sandbox Code Playgroud)
方案3:
cat test3.pl
#!/usr/bin/perl
### here I need to source the test1.sh script
print `$DATE`'
Run Code Online (Sandbox Code Playgroud)
如何在 perl 中获取 shell 以便在执行 test3.pl 时打印日期
谢谢拉古
perl ×1