Issue
I want to export the results of a Prodigy tagging session through the command rel="nofollow noreferrer">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 at 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:
- There is no need into explaining what that runuser or db-out commands are doing. I think the error is more related with a (possibly?) wrong variable sustitution from my side, that I am not seeing right now.
Solution
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:
DB_NAME="test1"
sudo runuser -l super_user -c "python3 -m prodigy db-out $DB_NAME > ./$DB_NAME.jsonl"
Just to make changes clear, they are:
- The single quotation marks were replaced by double ones.
- The inner double quotation marks were discarded.
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.
Answered By - David Espinosa Answer Checked By - Candace Johnson (WPSolving Volunteer)