[prog] Re : shell script

Diana Ionescu dianabesliu at yahoo.com
Sun Jun 24 09:19:50 UTC 2007

Hi Conor,

Many thanks.
Meantime I've had the time to fiddle with it and make the necessary constraints too.
The test function is pretty good.

See you next time....


----- Message d'origine ----
De : Conor Daly <conor.daly-linuxchix at cod.homelinux.org>
À : Diana Ionescu <dianabesliu at yahoo.com>
Cc : programming at linuxchix.org
Envoyé le : Vendredi, 22 Juin 2007, 16h37mn 47s
Objet : Re: [prog] shell script

On Thu, Jun 21, 2007 at 06:37:16PM -0700 or so it is rumoured hereabouts, 
Diana Ionescu thought:
> Hi there,
> Here is one of my questions that I don't have an answer for ... yet... and one of the "dumb questions"...
> I do have a solution - a C code written by my hubby, but I want my own :-))
> So... what I'm trying to do is: operate operation "bin_op" on two files which are listed in my LIST_i and LIST_j as rows.
> I'm getting the "name" of the file and the extensions (ex file name: 133012.fts - hhmmss.fts) and I want bin_op on the same row in both files, without 59 unnecessary files that are coming out from my script below.
> But if the difference between the times is -1 or 59 I don't want to do this difference.
> So I need a condition for "FOR"  not to go intro a double cycle or a condition on if to constrain all the unnecessary operations.
> For the moment I would be happy with the script below, IF dif=a-b would give me a number. As it is, a and b are just characters and a-b just prints 30-31 and dos not *do* 30-31=-1
>     a=$ATR_i
>     b=$ATR_j
>     dif=a-b

dif=$(( $a - $b )) 

should give you a number in $dif

if [ $dif -eq -1 ]; then

will do the test.

Conor Daly <conor.daly at cod.homelinux.org>
Version: 3.1
GCS/G/S/O d+(-) s:+ a+ C++(+) UL++++ US++ P>++ L+++>++++ E--- W++ !N
PS+ PE Y+ PGP? tv(-) b+++(+) G e+++(*) h-- r+++ z++++ 
http://www.geekcode.com/ http://www.ebb.org/ungeek/

Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail 

More information about the Programming mailing list