[PLUG] Shell script syntax
Russell Senior
seniorr at aracnet.com
Wed Oct 1 13:48:02 UTC 2003
>>>>> "Rich" == Rich Shepard <rshepard at appl-ecosys.com> writes:
Rich> I have 129 files to run through the gocr program; they're all
Rich> in a single directory. Is the following the proper syntax to run
Rich> the conversion?
Nope.
Rich> for i in *.pbm; do `gocr -o $i.txt -i $1.pbm`; done
a) that's not what backticks are for (if you don't know what they do,
you shouldn't be using them);
b) $1 is a typo;
c) .pbm is already part of what I assume you intended to be $i; and
d) (as stated elsewhere) $i.txt should probably be ${i%%.pbm}.txt.
--
Russell Senior ``shtal latta wos ba padre u prett tu nashtonfi
seniorr at aracnet.com mrlosh'' -- Bashgali Kafir for ``If you have
had diarrhoea many days you will surely die.''
More information about the PLUG
mailing list