Results 1 to 6 of 6
  1.    #1  
    yeah thats right !!! we can print our documents on any of our webOS phone (or for that matter any smartphone )using dropbox , using one simple VBVBVB $script$. $pl$ $visit$ $below$ $link$.

    How to Print Files from any Mobile Phone using Dropbox


    i wish ,i could copy files from one folder to another directly in my dropbox app ,any suggestion friends??
  2. mgmft's Avatar
    Posts
    199 Posts
    Global Posts
    230 Global Posts
    #2  
    I tried the linux script and I get a Syntax error!? Can anyone tell me what the error is?

    Error:
    /usr/sbin/dropprint.sh: Zeile 5: Syntaxfehler beim unerwarteten Wort `lpr'
    /usr/sbin/dropprint.sh: Zeile 5: ` lpr -o fit-to-page -o fitplot ${PrintQueue}/${PrintFile};'

    Using OpenSuSE 12.1.

    Script:
    #!/bin/bash
    export PrintQueue="/home/marcel/Dropbox/PrintQueue2";
    IFS=$'\n'
    for PrintFile in $(/bin/ls -1 ${PrintQueue}) do
    lpr -o fit-to-page -o fitplot ${PrintQueue}/${PrintFile};
    done
    Starting the lpr line manually works great!
  3. crabbz's Avatar
    Posts
    78 Posts
    Global Posts
    156 Global Posts
    #3  
    I think the problem is the for/do statements. put do on the next line by itself or put a semicolon in front of it.

    for PrintFile in $(/bin/ls -1 ${PrintQueue})
    do
    ...
    done
  4. #4  
    What crabbz said. The problem is that the way it's written originally, the word "do" becomes part of the list of files to print, which breaks the syntax of the loop. There's also some bits that can be removed from the script because ls(1) will just Do The Right Thing:

    #!/bin/bash
    export PrintQueue="/home/marcel/Dropbox/PrintQueue2";
    for PrintFile in `/bin/ls ${PrintQueue}`
    do
    lpr -o fit-to-page -o fitplot ${PrintQueue}/${PrintFile};
    done
  5. mgmft's Avatar
    Posts
    199 Posts
    Global Posts
    230 Global Posts
    #5  
    Thanks guys! That worked!!!
  6. mgmft's Avatar
    Posts
    199 Posts
    Global Posts
    230 Global Posts
    #6  
    Hi,

    I just modified the script to have the choice of printing in different paper sizes. A4 or A3

    #!/bin/bash
    export PrintQueue="/home/marcel/Dropbox/PrintQueue2/A4";
    IFS=$'\n'
    for PrintFile in $(/bin/ls -1 ${PrintQueue})
    do
    lpr -r -o fit-to-page -o fitplot -o media=A4 ${PrintQueue}/${PrintFile};
    done

    export PrintQueue="/home/marcel/Dropbox/PrintQueue2/A3";
    IFS=$'\n'
    for PrintFile in $(/bin/ls -1 ${PrintQueue})
    do
    lpr -r -o fit-to-page -o fitplot -o media=A3 ${PrintQueue}/${PrintFile};
    done

Posting Permissions