如何为shell脚本的以下情况stmt编写perl脚本
sciptname=$0
case ${sciptname} in
/*) scriptlocation=`dirname ${sciptname}`;;
*) scriptlocation=`dirname ${pwd}/${sciptname}`;;
esac
最佳答案
使用Cwd库函数abs_path
。
use Cwd 'abs_path';
my $script_location = abs_path( $0 );
关于linux - 如何将shell脚本case语句转换为perl脚本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40669218/