Sponsored Content
Top Forums Shell Programming and Scripting bash: correct quoting with find and exiv2? Post 302441511 by KenJackson on Saturday 31st of July 2010 12:24:35 PM
Old 07-31-2010
Does zbarimg support qrcode?

The command man zbarimg doesn't mention it, nor does it's site, zbar.sf.net.

---------- Post updated at 12:24 PM ---------- Previous update was at 12:09 PM ----------

You could also make a separate script and call it from find.
That would make sense if this is something you do occasionally or often.
Maybe put this in ~/bin/tagimg.
I haven't executed this, but it looks right.
Code:
#!/bin/sh
if [ -f "$1" ]; then
    $TEXT="$(zbarimg -q -Sdisable -Sqrcode.enable --raw "$1")"
    exiv -M "set Exif.Image.DocumentName '$TEXT'" "$1"
else
    echo "File not found \"$1\"" >/dev/stderr
fi

(Note that '$TEXT' gets expanded properly because the single quotes are inside double quotes.)

Then the find command becomes
Code:
find . -name '*.tif' -exec ~/bin/tagimg {} \;

 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

BASH quoting behavior

The block below isn't a surprise:$ ls file1 file2 file3 $ x=* $ echo $x file1 file2 file3 $ echo '$x' $x $ echo "$x" * $But I found this block a bit bewildering:$ echo $x' >' * $I'm wondering why substitution wasn't performed on the $x, since it was unquoted (as far as I can tell).... (5 Replies)
Discussion started by: na5m
5 Replies

2. Solaris

correct usage of find's -prune option

I know one of the more seasoned veterans probably opened this thread looking for their chance to refer me to the site's search feature and let me tell you. I'VE LOOKED!!!! And I didn't find anything helpful... So, I've got a windows background and I'm fond of its search feature which comes... (6 Replies)
Discussion started by: ProGrammar
6 Replies

3. Shell Programming and Scripting

Quoting issue: Trouble with bash strings in script

I can do this on the command line: sqsh -S 192.168.x.x -o tmp -U user -P fakepass -D horizon -C "\ select second_id from borrower where btype like '%wsd%' " I can also just leave the SQL at the end intact on one line .... ... However, when I throw this in a script like: $SQSH -o... (4 Replies)
Discussion started by: Bubnoff
4 Replies

4. Shell Programming and Scripting

Correct bash substitution

Hello! I'm writing a shell script using #!/bin/bash instead of #!/bin/sh because of the substitution: ${!variable}, which won't work with sh. My main problem is the following (just a summarized example, the script is much more complex): # sourced from a configuration file, we have a lot of... (6 Replies)
Discussion started by: teresaejunior
6 Replies

5. UNIX for Dummies Questions & Answers

How do I find the correct environment variables for MPI?

Hello all. I've been trying to install NWCHEM in parallel on a new cluster, and have been able to get it to work on single processors by ignoring any MPI environment variables. This is, of course, pretty worthless. So I'm starting over and trying to get thing set up right for the MPI. The key... (6 Replies)
Discussion started by: EinsteinMcfly
6 Replies

6. Shell Programming and Scripting

Check my script and correct the find command if wrong

Hello All, Here I am trying to find all the directories whose name starts with EFS or HOTFIX like in below example and below is my code but I don’t know why this is not working correctly. drwxr-xr-x 3 qabuild denccefs 4096 Sep 23 21:36 EFS110929A_SOURCE/ -rwxrwxr-x 1 qabuild... (2 Replies)
Discussion started by: anuragpgtgerman
2 Replies

7. Shell Programming and Scripting

Tricky BASH quoting question

I have some data files that I can identify by a certain pattern in the names using find. Every one of those data files has an XML file associated with it (can be multiple data files per XML file). The XML file is always up one directory from the data file(s) in a folder calledRun##### -... (12 Replies)
Discussion started by: Michael Stora
12 Replies

8. Shell Programming and Scripting

Help with Bash quoting

I am trying to write a BASH script that will prompt a user to enter a number of days, then calculate the date. My problem is the date command uses single or double quotes. For Example.. date -d "7 days" Here is an example of some same code I am trying to work through. echo "when do you... (4 Replies)
Discussion started by: javajockey
4 Replies

9. Shell Programming and Scripting

Cannot find correct syntax to make file name uppercase letters

I have a file name : var=UsrAccChgRpt I want to make them upper case. Tried: $var | tr Error: tr: Invalid combination of options and Strings. Usage: tr | -ds | -s | -ds | -s ] String1 String2 tr { -d | -s | -d | -s } String1 Could you please help. I am using AIX... (2 Replies)
Discussion started by: digioleg54
2 Replies
ZBar::ImageScanner(3pm) 				User Contributed Perl Documentation				   ZBar::ImageScanner(3pm)

NAME
Barcode::ZBar::ImageScanner - scan images for bar codes SYNOPSIS
use Barcode::ZBar; my $scanner = Barcode::ZBar::ImageScanner->new(); $scanner->parse_config('i25.disable'); $scanner->scan_image($image); DESCRIPTION
A Barcode::ZBar::ImageScanner is used to scan for bar codes in a Barcode::ZBar::Image. REFERENCE
Methods new() Create a new bar code image scanner instance. get_results() Return a list of Barcode::ZBar::Symbol results from the last scanned image. scan_image([image]) Scan a Barcode::ZBar::Image for bar codes. The image must be in the "Y800" format. If necessary, use "$image->convert("Y800")" to convert from other supported formats to Y800 before scanning. enable_cache([enable]) Enable the inter-image result consistency cache. parse_config(configstr) Apply a decoder configuration setting. See the documentation for "zbarcam"/"zbarimg" for available configuration options. recycle_image([image]) Remove previously decoded results from a Barcode::ZBar::Image and recycle the associated memory. SEE ALSO
Barcode::ZBar, Barcode::ZBar::Image, zbarimg(1), zbarcam(1) http://zbar.sf.net AUTHOR
Jeff Brown, <spadix@users.sourceforge.net> COPYRIGHT AND LICENSE
Copyright 2008-2009 (c) Jeff Brown <spadix@users.sourceforge.net> The ZBar Bar Code Reader is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. perl v5.14.2 2009-10-23 ZBar::ImageScanner(3pm)
All times are GMT -4. The time now is 12:50 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy