I have a Bash script that calls the Python script. First, I was just returning a variable and it Ok, but now I was asked to return two variables and I was wondering if there is a clean and easy way to return more than one variable. ArchiveID = $ (Python glacier_upload.py $ archive_file_name $ CURRENTVAULT)
What does the call do with bash
Archive archive_id ['ArchiveId'] archive_id ['ArchiveId'] This gives the archive ID to the batch script
Normally I know that you return many variables To do this, you can use a return statement in Python, but this is just a script the way I found a variable back. I can make it a festival called, but still, how will I get many variables which I will return?
From your python script, output one variable per line one variable Again, you read one variable per line, from the Bash script:
Python
print "foo bar" print 5 Bash
#! / Bin / bash Python main.py | While reading the line; Do echo $ line done last solution:
Thanks Guillaume! You gave me a great starting point out soultion. I'm just going to post my solution here for others. #! / Bin / bash array = () while reading the line; Array + = ($ line) done & lt; & Lt; (Python main.py) echo $ {array [@]}
The rest of the solution I want
No comments:
Post a Comment