RE: shell scripting style question

2002-12-05 Thread Price, Erik


 -Original Message-
 From: Kevin D. Clark [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, December 04, 2002 5:31 PM
 To: Charles Farinella
 Cc: [EMAIL PROTECTED]
 Subject: Re: convert large number of graphics
 
 [...]
 
 
 for A in `find /yourdir \( -name \*.bmp -o -name \*.BMP \) 
 -print` ; do
   bmptoppm $A | ppmtojpeg `echo $A | sed 's/\.bmp/.jpg/i'`
 done

Just out of curiosity, is the only difference between using
find and ls -R (in this particular case) that you can
use more than one glob argument?


Erik
___
gnhlug-discuss mailing list
[EMAIL PROTECTED]
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss



Re: shell scripting style question

2002-12-05 Thread Kevin D. Clark

Price, Erik [EMAIL PROTECTED] writes:

 -Original Message-
 From: Kevin D. Clark [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, December 04, 2002 5:31 PM
 To: Charles Farinella
 Cc: [EMAIL PROTECTED]
 Subject: Re: convert large number of graphics
 
  [...]
 
 
 for A in `find /yourdir \( -name \*.bmp -o -name \*.BMP \) 
 -print` ; do
   bmptoppm $A | ppmtojpeg `echo $A | sed 's/\.bmp/.jpg/i'`
 done

 Just out of curiosity, is the only difference between using
 find and ls -R (in this particular case) that you can
 use more than one glob argument?

Well, go to the top of a directory tree and type:

   find . -print

and compare this with 

   ls -R . | cat 

(or ls -1R -- ls outputs differently if it believes that it isn't
connected to a tty)


The output is different.  One happens to be easier to work with, IMHO.

find happens to be one of my favorite tools.

--kevin
-- 
``I also suggest that UNIX offers something else prized in literature: a
  coherence, a consistent style, something writers call a voice.''
  -- Thomas Scoville, ``The Elements of Style: Unix As Literature'',
 Unix Review's Performance Computing, September 1998

___
gnhlug-discuss mailing list
[EMAIL PROTECTED]
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss



RE: shell scripting style question

2002-12-05 Thread Price, Erik


 -Original Message-
 From: Kevin D. Clark [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, December 05, 2002 8:29 AM
 To: Price, Erik
 Cc: [EMAIL PROTECTED]
 Subject: Re: shell scripting style question
 
 
[...] 

 The output is different.  One happens to be easier to work with, IMHO.
 
 find happens to be one of my favorite tools.

I had forgotten that ls -R formats its output differently than
when it is non-recursive.

I think find is cool but I am not familiar with some of the
more advanced arguments, such as -exec {} etc... someone put on
a whole presentation on find at a LUG I was a part of at UMass
once, but I was unable to make that meeting.

I will have to /usr/bin/find some time to read the man page.


Erik
___
gnhlug-discuss mailing list
[EMAIL PROTECTED]
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss



Re: convert large number of graphics

2002-12-05 Thread pll

In a message dated: Wed, 04 Dec 2002 16:22:00 EST
Charles Farinella said:

I have to convert over 200 .bmp files to .jpg.  Is there a tool I can run 
from a command line to do this?  I looked at the documentation for both xv 
and display, but found nothing.  Suggestions?

Probably answered by now, but I'm 2 days behind in my e-mail :)

Install the ImageMagick package and use the 'convert' utility.
-- 

Seeya,
Paul
--
It may look like I'm just sitting here doing nothing,
   but I'm really actively waiting for all my problems to go away.

 If you're not having fun, you're not doing it right!


___
gnhlug-discuss mailing list
[EMAIL PROTECTED]
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss



Re: shell scripting style question

2002-12-05 Thread Jason Stephenson
There are several differences. I'd actually do the following:

find /yourdir -iname *.bmp -exec convert {} {}.jpg \;

Of course, if all the images are in a single subdirectory then a for 
loop would be better because you can do more variable substitution inside.

Something like this:

for file in /dir/*.bmp /dir/*.BMP
do
bname=${file%.}
convert ${file} ${bname}.jpg
done

That's in a sh-oriented syntax. Switching to csh is pretty simple.

Price, Erik wrote:


-Original Message-
From: Kevin D. Clark [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 04, 2002 5:31 PM
To: Charles Farinella
Cc: [EMAIL PROTECTED]
Subject: Re: convert large number of graphics



 [...]



for A in `find /yourdir \( -name \*.bmp -o -name \*.BMP \) 
-print` ; do
 bmptoppm $A | ppmtojpeg `echo $A | sed 's/\.bmp/.jpg/i'`
done


Just out of curiosity, is the only difference between using
find and ls -R (in this particular case) that you can
use more than one glob argument?


Erik
___
gnhlug-discuss mailing list
[EMAIL PROTECTED]
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss



___
gnhlug-discuss mailing list
[EMAIL PROTECTED]
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss



Re: shell scripting style question

2002-12-05 Thread Michael O'Donnell


I think of this question as being about the basic
behaviors of some important tools (the shell, find and
ls) that are worth understanding in their own right;
the style or scripting aspects seem secondary.


 Just out of curiosity, is the only difference between using
 find and ls -R (in this particular case) that you can
 use more than one glob argument?

You can specify multiple paths (which can in
turn be the result of shell globbing) to find,
so that doesn't really count as a difference.
Actually, find can also do its own globbing (ie.
file selection based on Regular Expressions
applied to filenames) where ls cannot.

In general, find is the far more powerful tool.
For example, you can tell find to mention
all files with a particular combination of
permissions, ownership and modification time at
a certain directory nesting level.  I usually
think of ls as a pretty-printer for directory
listings while find is the workhorse utility
for driving other tools, though ls can be used
in similar ways in the less demanding situations.

___
gnhlug-discuss mailing list
[EMAIL PROTECTED]
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss



Re: convert large number of graphics

2002-12-05 Thread Charles Farinella
On Wed, 4 Dec 2002, John Abreau wrote:

 Charles Farinella [EMAIL PROTECTED] writes:
 
  I have to convert over 200 .bmp files to .jpg.  Is there a tool I can run 
  from a command line to do this?  I looked at the documentation for both xv 
  and display, but found nothing.  Suggestions?

You guys are great, thanks!  Just what I needed.

--charlie

 
 Sure. display is the GUI component of ImageMagick; there are also a 
 bunch
 of command-line components. convert will convert between different 
 image formats:
 
 for i in *.bmp ; do convert $i `basename $8 .bmp`.jpg ; done
 
 or, if you're using a csh-flavored shell:
 
 foreach i ( *.bmp )
 convert $i `basename $i .bmp`.jpg
 end
 
 
 - --
 John Abreau / Executive Director, Boston Linux  Unix
 Email [EMAIL PROTECTED] / WWW http://www.abreau.net / PGP-Key-ID 0xD5C7B5D9
 PGP-Key-Fingerprint 72 FB 39 4F 3C 3B D6 5B E0 C8 5A 6E F1 2C BE 99
 
 
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.0.7 (GNU/Linux)
 Comment: Exmh version 2.5 07/13/2001
 
 iQCVAwUBPe6CWVV9A5rVx7XZAQJnhwP/dPQ2zkJFriovQsVD5grq1W3RaHu/wyLB
 8p7+gnAHqAQXiirCTjBPzc6fxPh7ugtjipWoHQ9XBhVsCnAW3wkyxZzg/srJpKGK
 tQnUKHMjDG3hHDWjunS+7zaDHikbUVNyNFEbTqejNMAIURzHo9eOneIE9v3Ro0Jl
 oRpTXfmkAjI=
 =gDxO
 -END PGP SIGNATURE-
 
 ___
 gnhlug-discuss mailing list
 [EMAIL PROTECTED]
 http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss
 

-- 

Charlie Farinella, Appropriate Solutions, Inc.
[EMAIL PROTECTED]
603-924-6079


___
gnhlug-discuss mailing list
[EMAIL PROTECTED]
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss



Re: shell scripting style question

2002-12-05 Thread Tom Buskey

[EMAIL PROTECTED] said:
  The ls(1) command is oriented more towards human consumption.  The find(1)  
command simple outputs a list of filenames, which is more suitable for
consumption by other programs.

I think find was targeted for use with cpio originally.  They both had
the same author.  They deal with arguments and options a bit different
then the other standard unix tools.

I'm almost surprised someone hasn't come up with a find replacement that
feels more like the other unix tools.  Tar certainly replaced cpio.
Then again, find works well as it is and I'm not sure you could replace 
its syntax as easily.

-- 
---
Tom Buskey


___
gnhlug-discuss mailing list
[EMAIL PROTECTED]
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss



Re: shell scripting style question

2002-12-05 Thread Jerry Feldman
I think that find has been around longer than cpio. I also think that it is 
an immensely useful Unix utility. Recursive descent was added to commands 
like ls and cp more recently. But, ls is more humanly usable.
Tom Buskey wrote:
 
 [EMAIL PROTECTED] said:
   The ls(1) command is oriented more towards human consumption.  The find(1)
   
 command simple outputs a list of filenames, which is more suitable for
 consumption by other programs.
 
 I think find was targeted for use with cpio originally.  They both had
 the same author.  They deal with arguments and options a bit different
 then the other standard unix tools.
 
 I'm almost surprised someone hasn't come up with a find replacement that
 feels more like the other unix tools.  Tar certainly replaced cpio.
 Then again, find works well as it is and I'm not sure you could replace 
 its syntax as easily.
 
 -- 
 ---
 Tom Buskey
 
 
 ___
 gnhlug-discuss mailing list
 [EMAIL PROTECTED]
 http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss
 

-- 
Jerry Feldman [EMAIL PROTECTED]
Boston Linux and Unix user group
http://www.blu.org PGP key id:C5061EA9
PGP Key fingerprint:053C 73EC 3AC1 5C44 3E14 9245 FB00 3ED5 C506 1EA9


___
gnhlug-discuss mailing list
[EMAIL PROTECTED]
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss



MonadLUG Thurs Night Meeting called due to weather.

2002-12-05 Thread Ray Cote
Due to the inclement weather and lousy driving conditions, the 
Monadnock Linux Users Group meeting for tonight (Thursday) is 
canceled.
Ray

--
___
gnhlug-discuss mailing list
[EMAIL PROTECTED]
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss


RE: Wal Mart sells cheap linux boxes

2002-12-05 Thread Travis Roy
They have been doing this for a while..

Few things about it.. They use mini-ITX motherboard, I recently got one,
they're neat, you can see what people have done with them at
mini-itx.com. They also come with Lindows, something I'm not to thrilled
about.. They had some tweaked version of WINE and some other stuff and
there was a big fight to get them to release the code (because it's
GPL'd or some form of a license very close to that), there was also some
other stuff the messed around with and never released the code for,
anyway, Lindows isn't very linux friendly.

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED]] On Behalf Of Price, Erik
 Sent: Thursday, December 05, 2002 5:04 PM
 To: [EMAIL PROTECTED]
 Subject: Wal Mart sells cheap linux boxes
 
 
 
 
 (from 
 http://www.cnn.com/2002/TECH/ptech/12/05/sproject.hs02.cheap.
 pc.reut/index.html)
 
 quote
 By dropping software from Microsoft and avoiding Intel 
 inside, retailer 
 Wal-Mart Stores is offering a $199 computer it says is a hot 
 seller on its 
 Web site, attracting novices looking for a way onto the 
 Internet as well as 
 high-end users wanting a second box.
 /quote
 ___
 gnhlug-discuss mailing list
 [EMAIL PROTECTED] 
 http://mail.gnhlug.org/mailman/listinfo/gnhlug -discuss
 

___
gnhlug-discuss mailing list
[EMAIL PROTECTED]
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss