#!/bin/bash
# 获取当前绝对路径
now_path=$(dirname $(readlink -f "$0"))
# 执行脚本
source ${now_path}/xxx.sh
linux下无论如何都能找到脚本的绝对路径
于 2022-08-22 14:54:14 首次发布
#!/bin/bash
# 获取当前绝对路径
now_path=$(dirname $(readlink -f "$0"))
# 执行脚本
source ${now_path}/xxx.sh