Command line question,

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,

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)

Similar Messages

  • Command line questions....

    I really have two questions here.
    First, I have a small server that is very similar to this one I pulled off a tutorial:
    public class MyServer{
    // A bare-bones example: exception handling omitted.
       public static void main( String args[] ){
          ServerSocket serv;
          serv = new ServerSocket( 5150 );
          while ( true ) {
             Socket s;
             s = serv.accept();          // Wait for a connection
             handle_connection( s );  // Got one, now do something!
            s.close();
    } When I run this program from the command line it goes into an infinite loop readily accepting connections.
    For the most part, this is what I want. But how do I gracefully exit the program? Simply closing the command window seems drastic, not to mention the list of exceptions it throws.
    Second question: Once I run my program, is there a way I can close the command line window and log off the computer without killing my program?
    thanks.
    (Running on NT)

    How do you stop the program? You write another program that connects to the same socket and sends a message that both programs agree means "Shutdown". When the server receives this message, it shuts down nicely.
    Now you want to run it as an NT service? I've seen people post links to a third-party package that can run a Java class as an NT service; I didn't note the link but you could probably find it by searching the forums.

  • Audio guys, LAME command line question

    Hey I know this is not the exact forum for this question but I figured you guys could help me better than anyone. I have a G5 running tiger server and a website that is recompressing uploaded MP3 files using LAME via command line. LAME seems to be mangling some of the files by creating distorted filed and 0 byte sized files. I am wondering is there an any other mac program that I can use to reencode mp3 files with the terminal and command line? LAME is said to be great but the files that are already at the frequency that I want (44.1) are converted ok but everything else is just mangled... any suggestions. Thanks!

    I guess I'm looking for either:
    a suggestion on why LAME might be messing up files, maybe someone wlse who had similar issues with LAME and found a fix
    or
    another mac program like LAME that I can run via command line through PHP to convert files.
    I'll play with automator and see if the itunes option might work.
    Thanks!

  • DOS command line question

    Hi, Isn't there a DOS command line symbol so that when javac returns all your syntax errors you can pause the screen before it blazes by your screen and you only catch the last few syntax errors. I thought it was javac whatever.java /p, but this doesn't work.
    Thanks.......gemann

    You might try
    javac yourClass | more
    but I seem to remember trying that without success.

  • Simple command line question

    i was wondering if there is a way to include all jar files from a single directory on the classpath when running java app from the command line.
    eg i am using this command:
    java -cp ..\libs\jar1.jar;..\libs\jar2.jar;..\libs\jar3.jar;..\classes package.Main
    what i want to be able to do is something like:
    java -cp ..\libs\*.*;..\classes package.Main
    i have tried using *, *.* and *.jar with no success. is it possible to do without setting environment variables etc.
    thanks

    >>
    It may be more error prone, but it's stilleasier. I
    use wildcards on the command line (and * in SQL)all
    the time, with few or no problems.
    Seriously this is a bad idea and you should stop
    doing it.
    You should always name your columns for SELECT (and
    for INSERT as well). For SELECT queries it offers the
    following benefitsSorry--I should have been more clear..
    I dont' use * in production SQL--for the reasons you mentioned. But I do a lot of one-off queries for testing, debugging etc.
    As for wildcards on the command line, again, for my daily putting around, there's not the risk that there is in production. In production, well, it may still be appropriate to use wildcards sometimes. You may actually want "everything in this directory, or that matches this pattern," where you don't know in advance what that will be. Regex comes to mind. :-)

  • QT Command Line Question

    I am looking for a script which I can convert movies through a simple line of code while being able to adjust Quality, file types to convert to, Frame Rates ...
    Pretty much all that Quicktime Pro can do.
    does anyone have an idea of where I can start?

    Try starting by opening the Script Editor in the /Applications/AppleScript folder, loading the QuickTime Player's AppleScript dictionary, and working until you create a script which does what you want. If you succeed in doing this, you can then create a command line method of converting the movies if you want to; post back for further assistance.
    There are a few pure command line tools for QuickTime, but all the ones I found can only play QuickTime files without having the capability to modify anything.
    (13221)

  • Command-Line question. Delete all but particular folders

    Hello. I need to create a batch file that will delete all folders within the "Users" folder except for the Administrator and Administrator.domainname.
    Can anyone help?
    Thanks

    You could try something along the lines of
    FOR /F "tokens=*" %%G IN ('DIR /B /A:D c:\test') DO if not "%%G" == "test2" if not "%%G" == "test3" rd /s /q "c:\test\%%G"
    but if you do, you may also delete
    c:\Users\Public
    c:\Users\Default         (a hidden folder)
    c:\Users\All Users       (a system folder)
    c:\Users\Default User (a system folder)
    Which may be regrettable. If you want an example of what happens then, try reading
    http://superuser.com/questions/219082/accidentally-deleted-user-profiles-on-windows-7-cant-log-on-with-other-users

  • OVM3.0.3 command-line question - how to clone

    Guys,
    I'm trying to do the following:
    take a hot clone every hour of a vm as a sort of backup of the vm
    I haven't noticed any functionality in the manager GUI. I need advise on the command to achieve this.
    Kind regards,
    J
    Edited by: JD on May 4, 2012 5:25 PM

    Have you tried this one: ovmcli-2.2-9.el5.noarch.rpm
    That should provide cli access to the Oracle VM GUI functions, including VM cloning. As a running VM results in a hot clone in OVM 3, maybe this will do th etrick for you. However, the release notes only mention OVM 2.2, but maybe it's worth a shot.

  • Another Terminal Command Line Question

    Now that I can successfully connect to my iMac back home vis SSH, I an having problems copying files from it to my iDisk using Terminal. Right now I am using the command, "cp filename.ext idisk_name/directory". When I try that, I get an "Operations not permitted" error. What am I doing wrong?

    Post these queries to the Unix forum under OS X Technologies where Unix and Terminal mavens frolic.

  • Edquota Command Line Question

    Ok. So I can use sudo edquota <username> and access the VIM editor for any user. Once I make changes, how do I apply/save those changes? I've tried typing :q and but they don't seem to apply these changes.
    Also, even after creating group quota files by using the following commands:
    sudo touch /.quota.group
    and
    sudo touch /.quota.ops.group
    I still can't access these groups using the quota editor. Any help?

    :w saves your work in vi. :wq will save and then exit. :q! will quit abandoning changes and :w! will save changes even if the permissions of a file forbid writing (but not if you neither own the file nor are root).
    Did you try edquota -g to edit the group quota?

  • Question about reading a string or integer at the command line.

    Now I know java doesn't have something like scanf/readln buillt into it, but I was wondering what's the easiest, and what's the most robust way to add this functionality? (This may require two separate answers, sorry).
    The reason I ask is because I've been learning java via self study for the SCJA, and last night was the first time I ever attempted to do this and it was just hellish. I was trying to make a simple guessing game at the command line, I didn't realize there wasn't a command read keyboard input.
    After fighting with the code for an hour trying to figure it out, I finally got it to read the line via a buffered reader and InputStreamReader(System.in), and ran a try block that threw an exception. Then I just used parseInt to get the integer value for the guess.
    Another question: To take command line input, do you have to throw an exception? And is there an easier way to make this work? It seems awfully complicated to take user input without a jframe and calling swing.
    Edited by: JGannon on Nov 1, 2007 2:09 PM

    1. Does scanner still work in JDK1.6?Try it and see. (Hint: the 1.6 documentation for the class says "Since: 1.5")
    If you get behaviour that doesn't fit with what you expect it to do, post your code and a description of our expectations.
    2. Are scanner and console essentially the same thing?No.
    Scanner is a class that provides methods to break up its input into pieces and return them as strings and primitive values. The input can be a variety of things: File InputStream, String etc (see the Scanner constructor documentation). The emphasis is on the scanning methods, not the input source.
    Console, on the other hand, is for working with ... the console. What the "console" is (and whether it is anything) depends on the JVM. It doesn't provide a lot of functionality (although the "masked" password input can't be obtained easily any other way). In terms of your task it will provide a reader associated with the console from which you can create a BufferedReader and proceed as you are at the moment. The emphasis with this class is the particular input source (and output destination), not the scanning.
    http://java.sun.com/javase/6/docs/api/java/util/Scanner.html
    http://java.sun.com/javase/6/docs/api/java/io/Console.html

  • Command-line type itunes control - questions

    Hello,
    I'm writing a little tool with Applescript to control iTunes via command-line type interface. I have few general questions, thanks in advance for any answers. First I'll explain my idea, questions at the end. (If wrong forum, please tell me where to go)
    The goal: to control music with as less hassle as possible. I listen music all day, have dozens of gigabites of it, and find mouse/iTunes interface too troublesome. Moodkiller whilst reading a book, for example.
    Tool is pop-up dialog, with a single text field. Write something and hit enter -> search phrase or command interpreted and sent to iTunes as Applescript -> iTunes acts, and a new dialog pops up, ready for next command. (Enter with no text quits app)
    Examples:
    "oasis wonderwall"
    Searches iTunes library and finds Wonderwall of Oasis. Displays a pop-up list of search matches, in this case just one song. Hit enter -> iTunes plays it. (If more results, I get to choose song from list.)
    I find this quicker than to activate iTunes search box with mouse, enter search string, activate results pane with several TAB:s etc...
    "trip-hop"
    Searches an iTunes library, finding over two hundred "trip-hop" genre songs. This time just plays random song among results (thumb rule: if number of results > 100, behave that way, otherwise as above). Library continues playing from that point. Usually means you get to hear a lot of trip-hop. (could also make new trip-hop playlist)
    ">"
    Command: skip to next song. ">>>" skips 3 songs at once, ">>>>" four songs etc
    "<"+" increases three notches, "++" four etc.
    Decrease volume, again "---" three notches etc.
    "play", "pause", "stop"
    Basic player commands, you name it.
    "oasis wonderw >"
    Searches song and adds it to end of current playlist (if more than one result, choose from list).
    Other ideas too, but you propably got the point.
    My questions:
    1) Any applications currently doing this kind of job? With iTunes or other music players? (You can use Quicksilver for iTunes song searching, but I'm not certain if that's very handy or fast)
    2) Would you use this kind of tool, if it were good? (just a theoretical question) If yes, how would you like to control it?
    3) I have used Applescript's basic "display dialog" and "choose from list" commands, but would love more customized pop-ups (fancier song lists etc). Pointers to good scripting additions to accomplish this? Currently the entire tool is made with Applescript.
    If this raises interest, I could post the tool somewhere. It's still very early draft, anyway.
    Cheers,
    O
    Helsinki

    Hi CofeeBreak,
    Thank you for your comment, but I was able to find the problem (didn't solve it yet): In the FM command line interface, calling a HEX file located in a folder with brackets in its name, such as "C:\hello_World(V1)\LabVIEW.hex" will not be recognized by the FM.exe, whereas "C:\hello_World_V1\LabVIEW.hex" will work just fine. In the Flash Magic GUI and Command Line Manual section on hex files there is no mention of that, my solution at the moment is to remove the brackets from folder names.
    Thanks
    Amir

  • Administration Port / command line /  console gui question

    In the Admin_ref.pdf doc it says "After enabling the administration port, all Administration Console traffic must connect via the administration port". Does this mean that you can no longer use the web gui console to manage the servers?
    I would like the option to script deployments (deploy ears, stop start servers etc.) via command line to reduce the possibility of user error during routine deployments.
    I do config mgmt. and am not a developer so I may be getting hung up on the language here.
    Thanks,
    gj

    Hi
    For first question the answer is no. With the administration port, you enable the SSL between the admin server and Node manager-managed Servers. You can still use the web console.
    For teh second question, you can use ANT or can use the WLS Scripting ..you can get more details in dev2dev.bea.com
    Jin

  • Java command line run code question?

    hello all:
    I met a question and want to get some suggestion from you.
    I have one file TestOne.java located in
    folder "c:\temp\aaa" which contains only one file(TestOne.java).
    package samples.java2beginner.gui;
    import java.io.*;
    public class TestOne {
         public static void main(String[] args) {
                System.out.println("hello world");
    }I use the following command to compile this java code:
    c:\temp\aaa\javac TestOne.java // everything is ok.
    In order to run this program, I have to manually create
    folder hierarch "samples\java2beginner\gui" in "c:\temp\aaa" and
    use the command
    c:\temp\aaa\java samples.java2beginner.gui.TestOne to run this program.
    My question is: is there any method that I can directly run
    this java program without manually create "samples\java2beginner\gui"
    which is annoying?
    thank you

    hello atmguy and DevMentee:
    Thank you for your great suggestion.
    I guess I didn't say my question clearly.
    The class file compiled from TestOne.java is TestOne.class which cannot be modified.(so i cannot erase the package line or any kind of modification)
    I want to run the java program from command line.
    currently I have to create "samples\java2beginner\gui" and copy TestOne.class to there.
    My question is: given one class file only(so you only get the TestOne.class),
    do you have method to run it from command line?
    so at this case you don't know which package the .class belongs to.
    You might think my question is silly. The reason I posted the question because
    I found problems when I use jode to decompiler a class file.
    JODE is a java decompiler from jode.sourceforge.net
    Given the above class file "TestOne.class", I cannot use jode to decompile it, because I have to run jode with the following method:
    c:\temp\aaa\java jode.decompiler.Main -cp samples.java2beginner.gui.TestOne
    which in fact is impossible given only .class file?
    because the reason we use jode is to decompiler, how can you know the package
    structure before decompile?!
    so the problem came to my original question.
    thank you all.

  • Design Question - Command Line Argument Processor

    Folks,
    I'm a java and OO newbie... I've been going through Sun's java tutorials
    I've "enhanced" Sun's RegexTestHarness.java (using Aaron Renn's gnu.getopt package) to expose the various Pattern.FLAGS on the command line.
    Whilst it does work the arguement processing code is awkward so I want to rewrite it... but I'm pretty new to OO, so before I spend days hacking away at a badly designed ArgsProcessor package I thought I'd run my deign ideas past the guru's... and atleast see if my ideas are impossible, or just plain bad.
    Any comments would be greatly appreciated.
    The starting point is RegexTestHarness.java/**
    *@source  : C:\Java\src\Tutorials\Sun\RegexTestHarness.java
    *@compile : C:\Java\src\Tutorials\Sun>javac -classpath ".;C:\Java\lib\java-getopt-1.0.13.jar" RegexTestHarness.java
    *@run     : C:\Java\src\Tutorials\Sun>java -classpath ".;C:\Java\lib\java-getopt-1.0.13.jar" RegexTestHarness -i
    *@usage   : RegexTestHarness [-vcixmslud]
    //http://java.sun.com/j2se/1.5.0/docs/api/java/io/package-summary.html
    import java.io.InputStream;
    import java.io.InputStreamReader;
    import java.io.BufferedReader;
    //http://java.sun.com/j2se/1.4.2/docs/api/java/util/regex/package-summary.html
    import java.util.regex.Pattern;
    import java.util.regex.Matcher;
    import java.util.regex.PatternSyntaxException;
    //http://www.urbanophile.com/arenn/hacking/getopt/gnu.getopt.Getopt.html
    import gnu.getopt.Getopt;
    import gnu.getopt.LongOpt;
    * private command line options interpreter class
    class Options {
         public boolean verbose = false;
         public int flags = 0;
         public Options(String progname, String[] argv) throws IllegalArgumentException {
              LongOpt[] longopts = new LongOpt[9];
              longopts[0] = new LongOpt("verbose",               LongOpt.NO_ARGUMENT, null, 'v');
              longopts[1] = new LongOpt("CANON_EQ",               LongOpt.NO_ARGUMENT, null, 'c');
              longopts[2] = new LongOpt("CASE_INSENSITIVE",     LongOpt.NO_ARGUMENT, null, 'i');
              longopts[3] = new LongOpt("COMMENTS",               LongOpt.NO_ARGUMENT, null, 'x');
              longopts[4] = new LongOpt("MULTILINE",               LongOpt.NO_ARGUMENT, null, 'm');
              longopts[5] = new LongOpt("DOTALL",                    LongOpt.NO_ARGUMENT, null, 's');
              longopts[6] = new LongOpt("LITERAL",               LongOpt.NO_ARGUMENT, null, 'l');
              longopts[7] = new LongOpt("UNICODE_CASE",          LongOpt.NO_ARGUMENT, null, 'u');
              longopts[8] = new LongOpt("UNIX_LINES",               LongOpt.NO_ARGUMENT, null, 'd');
              Getopt opts = new Getopt(progname, argv, "vcixmslud", longopts);
              opts.setOpterr(false);
              int c;
              //String arg;
              while ( (c=opts.getopt()) != -1 ) {
                   //arg = opts.getOptarg();
                   //(char)(new Integer(sb.toString())).intValue()
                   switch(c) {
                        case 'v': verbose = true; break;
                        //http://java.sun.com/docs/books/tutorial/essential/regex/pattern.html
                        case 'c': this.flags |= Pattern.CANON_EQ; break;
                        case 'i': this.flags |= Pattern.CASE_INSENSITIVE; break;
                        case 'x': this.flags |= Pattern.COMMENTS; break;
                        case 'm': this.flags |= Pattern.MULTILINE; break;
                        case 's': this.flags |= Pattern.DOTALL; break;
                        case 'l': this.flags |= Pattern.LITERAL; break;
                        case 'u': this.flags |= Pattern.UNICODE_CASE; break;
                        case 'd': this.flags |= Pattern.UNIX_LINES; break;
                        case '?': throw new IllegalArgumentException("bad switch '"+(char)opts.getOptopt()+"'"); //nb: getopt() spits
         public String toString() {
              StringBuffer s = new StringBuffer(128);
              if (verbose) s.append("verbose, ");
              if ((this.flags & Pattern.CANON_EQ) != 0)               s.append("CANON_EQ, ");
              if ((this.flags & Pattern.CASE_INSENSITIVE) != 0)     s.append("CASE_INSENSITIVE, ");
              if ((this.flags & Pattern.COMMENTS) != 0)               s.append("COMMENTS, ");
              if ((this.flags & Pattern.MULTILINE) != 0)               s.append("MULTILINE, ");
              if ((this.flags & Pattern.DOTALL)  != 0)               s.append("DOTALL, ");
              if ((this.flags & Pattern.LITERAL) != 0)               s.append("LITERAL, ");
              if ((this.flags & Pattern.UNICODE_CASE) != 0)          s.append("UNICODE_CASE, ");
              if ((this.flags & Pattern.UNIX_LINES) != 0)               s.append("UNIX_LINES, ");
              if (!s.equals("")) {
                   s.insert(0,"{");
                   s.replace(s.length()-2,s.length(),"");
                   s.append("}");
              return(s.toString());
    * public regular expression test harness
    public class RegexTestHarness {
         public static void main(String[] argv){
              BufferedReader in = null;
              try {
                   Options options = new Options("RegexTestHarness", argv);
                   //System.out.println(options);
                   in = new BufferedReader(new InputStreamReader(System.in));
                   System.out.println("RegexTestHarness");
                   System.out.println("----------------");
                   System.out.println();
                   System.out.println("usage: Enter your regex (none to exit), then the string to search.");
                   System.out.println("from:  http://java.sun.com/docs/books/tutorial/essential/regex/index.html");
                   String regex = null;
                   while(true) {
                        try {
                             System.out.println();
                             System.out.print("regex: ");
                             regex = in.readLine();
                             if (regex.equals("")) break;
                             Pattern pattern = Pattern.compile(regex, options.flags);
                             System.out.print("string: ");
                             Matcher matcher = pattern.matcher(in.readLine());
                             if (options.verbose) System.out.printf("groupCount=%d%n", matcher.groupCount());
                             while (matcher.find()) {
                                  System.out.printf("%d-%d:'%s'%n", matcher.start()+1, matcher.end(), matcher.group());
                                  //start is a zero based offset, but one based is more meaningful to the user, Me.
                        } catch (PatternSyntaxException e) {
                             System.out.println("Pattern.compile("+regex+") " + e);
                        } catch (IllegalStateException e) {
                             System.out.println("matcher.group() " + e);
                   } //wend
              } catch (IllegalArgumentException e) {
                   System.out.println(e);
              } catch (Exception e) {
                   e.printStackTrace();
              } finally {
                   try {in.close();} catch(Exception e){}
    }... I haven't got a clue if it's possible, but I want my ArgProcessor.getArgs method to return a hash (keyed on name) of Objects of the requested "mixed" types... for example a boolean, a String, and a String[].
    I want the client code of my new fangled ArgProcessor to look something like this:class testArgProcessor {
         public static void main(String[] args) {
              //usage testArgProcessor [-v] [-o outfile] file ...
              try {
                   HashMap<Arguement> args = ArgProcessor.getArgs( args,
                        { //hasArg value, letter, name, type, value, default
                          {hasArg.NONE,     'v', 'verbose', 'boolean', true, false}
                        , {hasArg.REQUIRED, 'o', 'outfile', 'String', null, null}
                        , {hasArg.ARRAY,     '', 'filelist', 'String[]', null, null}
                   if (args.outfile != null) {
                        out = new BufferedWriter(......);
                   } else {
                        out = System.out;
                   for (String file : filelist) {
                        if (args.verbose) System.out.println("processingFile: " + file)
                        ... process the file ...
              } catch (IllegalArgumentException e) { //from ArgProcessor.getArgs()
                   System.out.println(e);
    }

    Paul,
    What are you trying to do, and why?Sorry I should have made myself a lot clearer...
    What I'm really trying to do is learn Java, and good OO design... so I'm going through the Sun tutorials, and I see that the standard Pattern class has a few handy switches, so I wanted to expose them to the command line... which I did using the handy gnu.getopts library...
    Are you trying to write a general purpose
    command-line processing library?Yes, I'm trying to write a general purpose command-line processing library? one that's "cleaner" to use than the gnu.getopts.
    I've been hacking away for a few hours and haven't gotten very far... what I have discovered is that gnu.getopts class is in fact very clever (surprise surprise)... and my idea to "simplify" it's usage leads to loss of flexibility. So, I'm starting to think I'm completely barking up the wrong tree... and that I was somewhat vanglorious thinking that I (a newbie) could improve upon it.
    Are you trying to write a command-line app to do
    pattern matching?Yep, That too... That's where I started... with an example from Sun's tutorials... where it's used to parse a long series of patterns and strings, exploring java's regex capabilities.
    I think I'll just give up on "improving" on gnu.getopts... my options processing code is ugly, and so be it.
    Thanx for your interest anyway.
    Keith.

Maybe you are looking for

  • How can i change column header value dynamically in IR report

    HI, I have created report with the help of collections. Report query has been changing dynamically but i got problem with report header names and headers names has not been changing dynamically it is always showing like c001,c002....etc so, i have cr

  • How to Open new screen for single click on ALV icon.

    Hi All, Can any body help me regarding the below ALV requirement. I need to create a executable program ZPROGRAM with a table having field to store long text.The ALV report should display records according to the selection screen parameters with a ic

  • Which files to save prior to formatting?

    Hi there! I am going to format Windows 7 today and I would like to know which files and folders I need to save for one of my premiere pro projects to be able to re open it once Windows has been reinstalled? Do I need the preview files and encoded fil

  • HOW TO cache user clicks on links with attributes such as "_blank" ?

    HOW TO cache user clicks on links with attributes such as "_blank" in Adobe AIR with JS or MXML or AS3 for creating new costume browser window (AIR) ?

  • Install Errors-Zen 7 SP1 Desktop Management

    I had a server die that used to do my Zen Imaging. I installed that server 4 years ago. I am trying to install it on a different NW6.5 SP7 server. It goes through the install process, but when it finishes, it has the errors listed below. Does anyone