You are not logged in.
Pages: 1
Hi all,
I am using googlecl to upload a bunch of picture to my picasa account, so far no issue.
But if i'm using ~/picasa-upload/*.JPG it will upload all but in a random order.
see outcome below:
Loading file /home/sweetth/picasa-upload/SDC10825.JPG to album Newcastle
Loading file /home/sweetth/picasa-upload/SDC10809.JPG to album Newcastle
Loading file /home/sweetth/picasa-upload/SDC10740.JPG to album Newcastle
Loading file /home/sweetth/picasa-upload/SDC10781.JPG to album Newcastle
I want to have them to upload from SDC10655.JPG to SDC10800.JPG
is there a way to right the commands to do have the upload happening in numerical order?
Many thanks,
Offline
Maybe you could do something like
ls *.JPG | xargs googlecl additionalparameters
ls will list sorted by name by default, and xargs will build an argument list
by data received on stdin (in this case the output of ls)
You should check out the xargs manpage, but to help any more we need to
know the full parameter list (of course sumstitute password for dummy data
etc.)
Last edited by tlvb (2010-11-01 11:23:52)
I need a sorted list of all random numbers, so that I can retrieve a suitable one later with a binary search instead of having to iterate through the generation process every time.
Offline
maybe kind of sort could help too.
ls *.JPG | sort | xargs googlecl additionalparameters
Offline
Don't parse ls, it is bad.
Last edited by Mr.Elendig (2010-11-01 12:11:57)
Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest
Offline
without any reason?
Offline
Slower and more error prone.
If you want to sort the filenames using sort, someting like `printf '%s\n' * | sort -r` can be 2x faster then `ls | sort -r`
But as a different note. globbing in bash is sorted alphabetically, so you could simply use a for loop instead to get them uploaded in order.
The upload script you are using might not have an internal ordering, but a for loop would negate that.
Edit: stupid internet keeps hanging and messing up my posting
Last edited by Mr.Elendig (2010-11-01 12:56:40)
Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest
Offline
Allthough ls works ok here, parsing ls output is a bad habit in general because a) the output will differ across implementations, b) it will cause problems if it's used in a for loop like this, and c) it is often not necessary at all...
Just loop over a glob in bash:
for f in *.JPG; do googlecl "$f"; done
(this will call googlecl for each file individually, not sure if that's what you want)
Or use find and xargs instead of ls:
find . -name '*.JPG' -print0 | xargs -0 googlecl
Last edited by hbekel (2010-11-01 12:58:38)
Offline
If you're not uploading *.JPG, here's how you glob the range you've given as an example - just substitute it into the commands above.
SDC10@(6[5-9][5-9]|7[0-9][0-9]|800).JPG
test it with:
ls SDC10@(6[5-9][5-9]|7[0-9][0-9]|800).JPG
before doing anything substantial.
"...one cannot be angry when one looks at a penguin." - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle
Offline
find . -name '*.JPG' -print0 | xargs -0 googlecl
boo to extraneous processes ;P
find . -name '*.JPG' -exec googlecl {} \+
note the \+ vs the usual \;
find also accepts -regex if you want to get fancy with skanky's stuff too.
//github/
Offline
Right,
It is actually easier, rather than calling the google script then telling what to do.
If I launch "google picasa post --title Newcastle ~/picasa-upload/*.JPG"
They will be upload in order....
Why make it so complicated when it's simple...
Offline
hbekel wrote:find . -name '*.JPG' -print0 | xargs -0 googlecl
boo to extraneous processes ;P
Guilty I wasn't aware of -exec ... {} \+, thanks for the tip!
Offline
Pages: 1