diff --git a/shell/otask.sh b/shell/otask.sh index 516a9439..7d764c73 100755 --- a/shell/otask.sh +++ b/shell/otask.sh @@ -92,7 +92,7 @@ run_normal() { cd $dir_scripts local relative_path="${file_param%/*}" - if [[ ${file_param} != /* ]] && [[ ! -z ${relative_path} ]] && [[ ${file_param} =~ "/" ]]; then + if [[ ! -z ${relative_path} ]] && [[ ${file_param} =~ "/" ]]; then cd ${relative_path} file_param=${file_param/$relative_path\//} fi diff --git a/shell/preload/sitecustomize.py b/shell/preload/sitecustomize.py index f4c51dd6..51b78548 100644 --- a/shell/preload/sitecustomize.py +++ b/shell/preload/sitecustomize.py @@ -42,7 +42,7 @@ def run(): os.environ["PYTHONPATH"] = prev_pythonpath split_str = "__sitecustomize__" - file_name = sys.argv[0].replace(f"{os.getenv('dir_scripts')}/", "") + file_name = os.path.abspath(sys.argv[0]).replace(f"{os.getenv('dir_scripts')}/", "") # 创建临时文件路径 temp_file = f"/tmp/env_{os.getpid()}.json"