[KLUG Members] To shell or not to shell...

richard@knbpower.com members@kalamazoolinux.org
Wed, 17 Jul 2002 10:17:33 -0400


OK, let's see if I've got my email reconfigured to be more friendly to our
mailing list......

"ls *.902 > /tmp/ha902"

/tmp/ha902 looks like:

21245047.902
21245051.902
21245057.902...

   My apologies... I was mistaken on what I was using on the command line...

   Goose



Original Message:
-----------------
From: Adam Williams adam@morrison-ind.com
Date: Mon, 15 Jul 2002 15:17:49 -0400 (EDT)
To: members@kalamazoolinux.org
Subject: RE: [KLUG Members] To shell or not to shell...


>This just might help you.... I ls -al a directory into a temp file, then
>read it back to extract filenames to transmit via email. Hopes this
helps...
>#!/bin/bash
>while read temp; do
>        echo -n "sending $temp to ec.up.com "
>        cat $temp | mail -s **EDI** UPTEDI@ec.up.com
>        echo "Done"
>        mv $temp sent
>        let num=num+1
>        sleep 5
>done < /tmp/ra96e
>The read command will pickup the line from the file /tmp/ra96e one line
>at a time and continues until it reaches the eof.

I'm pretty sure that read actually scans until the first occurance of
whitespace,  not neccesarily the end of line "\n".  So filenames with
whitespace in them will mess this up.

Do you do an "ls -al" or an "ls -1"?

_______________________________________________
Members mailing list
Members@kalamazoolinux.org



--------------------------------------------------------------------
mail2web - Check your email from the web at
http://mail2web.com/ .