[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bash patch for sequences (MATLAB-like notation)

From: Mir Adnan ALI
Subject: Bash patch for sequences (MATLAB-like notation)
Date: Wed, 23 Apr 2003 07:31:17 -0400 (EDT)

Homepage: http://pnr.ca/maali/bash-patch.txt
Patch:    http://www.pnr.ca/maali/bash-2.05b-seq.patch
Tar/GZ:   http://www.pnr.ca/maali/bash-2.05b-seq.tar.gz
Mirror:   http://www.eyetap.org/~maali/pub/bash-patch/


It is difficult in bash to work with sequences of files, such as:

LM0000000.mif LM0000001.mif LM0000002.mif LM0000003.mif
LM0002615.mif LM0002616.mif LM0002617.mif LM0002618.mif
LM0002619.mif LM0002620.mif LM0002621.mif LM0002622.mif
LM0002631.mif LM0002632.mif LM0002633.mif LM0002634.mif
LM0004997.mif LM0004998.mif LM0004999.mif LM0005000.mif

These sequences are common when working frame-by-frame on video,
e.g. using film gimp (cinepaint), or in medical imaging, and also
occur in many other situations.

There are no simple bash expressions for selecting arbitrary
sequences, so you might want to try this patch.

       echo {1:10}
              Prints "1 2 3 4 5 6 7 8 9 10"

       echo {10:2:0}
              Prints "10 08 06 04 02 00"

       rm LM{000:298}.mif
              Delete files LM000.mif, LM001.mif, ..., LM298.mif  

       rm LM{200:5:300}.mif
              Delete every fifth file: LM200.mif, LM205.mif, ...,

       scan LM{300:5:200}.mif > cmp300down.scan
              Compare every fifth  file  in  reverse:  LM300.mif,
              LM295.mif, ..., LM200.mif.

This patch was written by "Mir Adnan ALI" <maali at pnr.ca>, with
help from "Florian Vogt" <fvogt at ece.ubc.ca> and "Steve Mann"
<mann at eyetap.org>.

This code is released under the GPL version 2. 
Copyright is assigned to FSF.  No warranty whatsoever.
Use at your own risk.  Alpha release.
Please report bugs/suggestions to maali at pnr.ca.

Try it out!   
Quick method to build:
    wget ftp://ftp.cwru.edu/pub/bash/bash-2.05b.tar.gz
    wget http://pnr.ca/maali/bash-2.05b-seq.patch
    tar zxvf  bash-2.05b.tar.gz
    cd bash-2.05b
    rm configure
    patch -p1 < ../bash-2.05b-seq.patch

reply via email to

[Prev in Thread] Current Thread [Next in Thread]