[TriLUG] tab stops in a bash shell

Craig Taylor ctalkobt at gmail.com
Fri Sep 19 23:20:24 EDT 2008


I assume you mean you're wanting to parse tab delimited files in a bash
script? If so, the key is setting the IFS / Interfield seperator environment
variable. (Man on bash search for IFS).

Eg:

#!/bin/bash
IFS="\t"
cat t2.tab | while read x y z; do
  echo "$x / $y / $z"
done

should work for a 3 field tab delimited file with the tab character.

On Fri, Sep 19, 2008 at 4:10 PM, stan briggs <stanbriggs at gmail.com> wrote:

> all,
> does anyone know how to change the tab stops that are used from inside of a
> bash script?
>
> thanks,
> stan
>
> --
> Stan B. Briggs
> +1-919-414-9513
> +++++++++++++++++++
> the oBoJ Foundation is the open source community coming together for the
> benefit of society. our events and work are for the purpose of raising
> awareness, raising funds, and performing activities for good causes.
> participation is open to all who wish to support worthwhile public causes.
> www.oBoJ.org
> +++++++++++++++++++
> Little tiny dreams require little tiny thoughts and little tiny steps.
> Great big dreams require great big thoughts and little tiny steps.
> +++++++++++++++++++
> --
> TriLUG mailing list        : http://www.trilug.org/mailman/listinfo/trilug
> TriLUG FAQ  : http://www.trilug.org/wiki/Frequently_Asked_Questions
>



More information about the TriLUG mailing list