Formatting of bootscripts

S. Anthony Sequeira tony at sequeira.org.uk
Tue Jan 4 11:54:19 PST 2005


On Tue, 2005-01-04 at 11:27 -0600, David Jensen wrote:
> Jeremy Utley wrote:
> > For me, I'm in favor of remaining as tabs:  1)  as said previously, it 
> > allows someone to decide for themselves how things should look, and 2) 
> > the fact that a tab character in a text file is only one byte, while 
> > spaces are multiple bytes.
> > 
> > -J-
> 
> I remember pkzip packed smaller with spaces even though the file is larger. 
> This seems true also with gzip and bzip2.  I only tried one 15k source file 
> with tab4 and the same with the tabs as spaces.
> 
> fwiw here is what I use when the source is a messed up mix of both:
> 
> #!/bin/sh
> # tab_to_space number file
> SPACES=""
> for ((a=0; a<$1; a++))
> do
>     SPACES=$SPACES" "
> done
> sed -i "s@\t@$SPACES at g" $2
> #end tab_to_spc

I take it you prefer to use this rather than expand.

EXPAND(1)                        User Commands
EXPAND(1)

NAME
       expand - convert tabs to spaces

SYNOPSIS
       expand [OPTION]... [FILE]...

DESCRIPTION

or unexpand to go the other way:)
-- 
Civilization, as we know it, will end sometime this evening.
See SYSNOTE tomorrow for more information.





More information about the lfs-dev mailing list