Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bash脚本中的cd操作似乎不在被生成的二进制应用支持? #44

Open
fengmao31 opened this issue Jan 8, 2025 · 1 comment

Comments

@fengmao31
Copy link

image

#!/bin/bash

# Ensure the script exits if any command fails
set -e

# Check if the correct number of arguments is provided
if [ "$#" -lt 2 ]; then
    echo "usage:./pnc_map file <file>"
    echo "file: mat file"
    exit 1
fi

# 重定向应用运行目录
CURRENT_DIR="$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd -P)"
cd ${CURRENT_DIR}
echo "current dir is ${CURRENT_DIR}."
@liberize
Copy link
Owner

liberize commented Jan 8, 2025

你可以试试加上-0选项。另外可能需要把${BASH_SOURCE[0]}换成$0。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants