Loading

bash / powershell切换到脚本所在目录

切换工作目录到脚本所在目录

bash:

#!/usr/bin/env sh
cd $(dirname $0)
#cd $(dirname $(readlink $0)) #soft  link

powershell:

$dir = Split-Path -Parent $MyInvocation.MyCommand.Definition
cd $dir

https://www.cnblogs.com/FlyFive/p/3640267.html

posted @ 2019-11-05 11:24  wswind  阅读(1757)  评论(0编辑  收藏  举报