httpd-test-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Roy T. Fielding" <>
Subject Re: cvs commit: httpd-test/specweb99/specweb99-2.0 mod_specweb99.c
Date Tue, 14 Jan 2003 21:10:35 GMT
> Does anyone have a perl script etc. to automatically convert all 
> leading tabs to n blanks?  I was thinking of manually de-tabifying in 
> the vicinity of this fix, but it would be better to do the whole thing 
> if I can get my hands on such a tool.

Most Unices have a command called "expand" that does just that.

EXPAND(1)               System General Commands Manual               

      expand, unexpand - expand tabs to spaces, and vice versa

      expand [-tabstop] [-tab1,tab2,...,tabn] file ...
      unexpand [-a] file ...

      expand processes the named files or the standard input writing the 
      dard output with tabs changed into blanks.  Backspace characters 
are pre-
      served into the output and decrement the column count for tab 
      tions.  expand is useful for pre-processing character files 
(before sort-
      ing, looking at specific columns, etc.) that contain tabs.

      If a single tabstop argument is given, then tabs are set tabstop 
      apart instead of the default 8.  If multiple tabstops are given 
then the
      tabs are set at those specific columns.

      unexpand puts tabs back into the data from the standard input or 
      named files and writes the result on the standard output.

      Option (with unexpand only):

      -a    By default, only leading blanks and tabs are reconverted to 
            strings of tabs.  If the -a option is given, then tabs are 
            whenever they would compress the resultant file by replacing 
two or
            more characters.

      The expand command appeared in 3.0BSD.

4th Berkeley Distribution        June 9, 1993        4th Berkeley 


View raw message