|
Programming C, bash, Python, Perl, PHP, Java, you name it. |
|
Thread Tools | Display Modes |
|
|||
djvu conversion (c44) command
Hello folks!
I know my question will seem trivial to a programmer, but please help. I have a lot of .jpg files in a directory, and need to convert them to .djvu format. The c44 command doesn't seem to accept wildcards eg.: "c44 *", you can only write the actual file name one by one to have them converted. Since I have nearly 300 files, it is quite inconvenient. What would a small script that will do the job look like? thank you |
|
|||
Code:
for img_file in *.jpg; do echo $img_file done
__________________
...then the God created man... |
|
|||
For loop would be the easiest solution, or maybe you wanna have some fun with find and xargs:
Code:
$ find dir -name "*.jpg*" -exec convert_to_djvu_cmd {} \; Code:
$ find dir -name "*.jpg*" | xargs convert_to_djvu_cmd
__________________
...then the God created man... |
|
|||
thank you for you quick answer!
The "-exec" variant worked with errors, the "xargs" variant did not work The "for" variant worked without errors with a small change: for FILE in * ; do c44 $FILE ; done thanks a lot |
|
|||
You can redirect the output of the following sed command to file
Code:
$ ls *jpg | sed -e 's/^/c44 /' c44 100_0574.jpg c44 I_am_hungry.jpg c44 dweilen.jpg
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to modify the ls command? | bsdnewbie999 | OpenBSD General | 9 | 16th May 2009 08:20 AM |
Delayed command? | wubrgamer | Other BSD and UNIX/UNIX-like | 9 | 22nd April 2009 03:15 AM |
avidemux2 command line | roddierod | FreeBSD General | 1 | 10th November 2008 08:27 PM |
pkg-get command not found | whispersGhost | Solaris | 2 | 11th June 2008 01:06 PM |
crypt command | whispersGhost | Solaris | 3 | 9th June 2008 05:37 AM |