Bash ShellPowerShell实现:切换工作目录到脚本所在目录。 Bash Shell#!/usr/bin/env shcd $(dirname $0)#cd $(dirname $(readlink $0)) #soft link PowerShell$dir = Split-Path -Parent $MyInvocation.MyCommand.Definitioncd $dir