[TriLUG] tab stops in a bash shell

stan briggs stanbriggs at gmail.com
Sat Sep 20 09:41:17 EDT 2008


craig,

good guess considering my sparse description but incorrect in this case.

i'm trying to control tab stops on printed output. by default, as you
probably know, tab stops in the bash shell are set for every 8 positions. i
want to set them to a different set of values that are not evenly spaced. i
thought that setterm would do this but it appears to not have the set of
options that i would expect it to.

did i mention that this is on solaris 10? i would have thought that it
wouldn't matter but i just checked setterm on my ubuntu 7.04 box and it does
have the -regtabs and -tabs options. hmmm, i wonder if my question just
changed?

stan

On Fri, Sep 19, 2008 at 11:20 PM, Craig Taylor <ctalkobt at gmail.com> wrote:

> 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
> >
> --
> TriLUG mailing list        : http://www.trilug.org/mailman/listinfo/trilug
> TriLUG FAQ  : http://www.trilug.org/wiki/Frequently_Asked_Questions
>



-- 
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.
+++++++++++++++++++



More information about the TriLUG mailing list