bash变量替代
我想通过命令 db-out 。 Prodigy安装在a Google Compegute Engine vm,但是,我不是它的所有者,为此原因,我正在尝试的是这样:
# Assume `test1` exists
DB_NAME="test1"
# `super_user` is Prodigy owner's home directory.
sudo runuser -l super_user -c 'python3 -m prodigy db-out "$DB_NAME" > ./"$DB_NAME".jsonl'
以前的命令应生成test1.jsonl
文件,该文件应在super_user
home Directory中找到。但是,没有生成test1.jsonl
。顺便说一句,当运行这些行时,不会显示警告或错误。
但是,当我直接运行以下命令时:
sudo runuser -l super_user -c 'python3 -m prodigy db-out test1 > ./test1.jsonl'
test1.jsonl
文件是正确生成的,如前所述和解释。为什么?
其他注释/更新:
I want to export the results of a Prodigy tagging session through the command db-out. Prodigy is installed in a Google Compute Engine VM, however, I am not the owner of it and for that reason, what I am attempting, looks like this:
# Assume `test1` exists
DB_NAME="test1"
# `super_user` is Prodigy owner's home directory.
sudo runuser -l super_user -c 'python3 -m prodigy db-out "$DB_NAME" > ./"$DB_NAME".jsonl'
The previous commands should generate a test1.jsonl
file, which should be found in the super_user
home directory; however, no test1.jsonl
is generated. BTW, when those lines are run, no warning or error is displayed.
Nevertheless, when I directly run the following command:
sudo runuser -l super_user -c 'python3 -m prodigy db-out test1 > ./test1.jsonl'
test1.jsonl
file is correctly generated, as expected and explained before. Why?
Additional notes / updates:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在我注意 Gordon Davidson ,强烈建议谁修订),我设法解决了我的原始问题。校正的代码看起来如下:
为了清楚更改,它们是:
之后,该脚本可以按原样运行。如果我理解这篇文章正确地,可能还有其他有效的答案;但是,这是现在起作用的。
谢谢。
After addressing my attention to this post (which was kindly suggested by Gordon Davidson, and whose revision is highly suggested), I managed to solve my original issue. The corrected code looks like follows:
Just to make changes clear, they are:
Afterwards, the script works as it is supposed to be. If I understand this post correctly, there could be some other valid answers; however this one works for now.
Thank you.