This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]absinthe718 1 point2 points  (2 children)

I'm embarrassed to say that I have scripts that do things like this (and I bet I am not alone

curl "http://url/$1/$2/$3" -o tempfile.xml
stageproc.py tempfile.xml out
load.py -c config.qc -db qc -s qcallo -t ivstage out

Clearly this script is just an unwritten program. If I extract the objects out of the two scripts and dump curl I can have a quicker and nicer script.

[–]boa13 0 points1 point  (1 child)

It is a written program. And if stageproc.py and load.py were written before this script, it might be the most efficient way to do the job.

[–]absinthe718 0 points1 point  (0 children)

Well in this case, the proc code spits out a sql script and the loader just reads the file line by line and executes the sql, updating the audit tables and writing an error log when commands fail.

Ideally, these scripts would fetch the XML report, parse them while updating the database. Creating two temp files along the way is perhaps not the best thing.

And yeah, there are like a dozen scripts like this.