切换工作目录到脚本所在目录
bash:
#!/usr/bin/env sh
cd $(dirname $0)
#cd $(dirname $(readlink $0)) #soft link
powershell:
$dir = Split-Path -Parent $MyInvocation.MyCommand.Definition
cd $dir
切换工作目录到脚本所在目录
bash:
#!/usr/bin/env sh
cd $(dirname $0)
#cd $(dirname $(readlink $0)) #soft link
powershell:
$dir = Split-Path -Parent $MyInvocation.MyCommand.Definition
cd $dir