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

Test case script #214

Closed
abigcoder04 opened this issue Oct 18, 2022 · 1 comment
Closed

Test case script #214

abigcoder04 opened this issue Oct 18, 2022 · 1 comment

Comments

@abigcoder04
Copy link

|>
[root@host-10-208-55-132 qp2]# vi test.sh
|>
[root@host-10-208-55-132 qp2]# bash test.sh
test.sh: line 4: qp: command not found
test.sh: line 5: qp: command not found
test.sh: line 6: qp: command not found
|>
[root@host-10-208-55-132 qp2]# qp
qp - Shell function of the qpsh shell

Why can I execute the qp statement directly on the command line, but if I put the qp statement inside the script and let the script execute it, it will show that the qp operation cannot be found

@scemama
Copy link
Member

scemama commented Oct 18, 2022

qp is a shell command introduced in your current shell when you source /path/to/qp2/quantum_package.rc. When you run test.sh, you execute a new bash to run your script, and the qp function is not inherited in this new shell.
You should add source /path/to/qp2/quantum_package.rc to your test script for it to know the qp command, or you can execute your script in the same shell: source script.sh

@scemama scemama closed this as completed Oct 18, 2022
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