coreutils maintainers:

unexpand will expand 2 or more spaces/tabs into an appropriate set of tabs
and spaces.  Could it be enhanced with an option to convert 1 space into a
tab also, when appropriate?  For example, with this command:

   echo "abcdef  abcdefg abcdefgh" | unexpand -t 8

The 2-space sequence after abcdef is converted to a tab, but the single space
after abcdefg is not, presumably because there's no space savings in doing
so.  But it sure would be convenient if there was an option to convert it to
a tab, too.  I've wanted this before when writing shell scripts to read
columnar input.  It would be nice to use unexpand like this (in ksh):

   unexpand --singletons-too -t 8,20,52 < /some/file | 
   while IFS='  ' read -r field1 field2 field3 field4; do
      ...
   done

-- 
Todd Allen
Concurrent Computer Corporation


_______________________________________________
Bug-coreutils mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to