[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#28985: expand --tabs transposes expansions in output, does other une
From: |
Chris King-Parra |
Subject: |
bug#28985: expand --tabs transposes expansions in output, does other unexpected things |
Date: |
Tue, 24 Oct 2017 22:21:42 -0400 |
Package: coreutils
Version: 8.28
Hi there,
I was reading the info pages for ``expand`` this afternoon and came across the
``--tabs`` option. To my understanding, you supply it with a comma separated
list of numbers. Each number specifies how many spaces to replace the next
occurrence of a tab with. The ``/`` character can be used to prefix a number,
which will then be used for the number of spaces to expand to for every tab in
and after that occurrence.
Here's an excerpt of an example from the info page, describing the ``--tabs=``
option:
> As a GNU extension the last tab specified can be prefixed with a ‘/’ to
indicate a tab size to use for remaining positions. For example, --tabs=2,4,/8
will set tab stops at position 2 and 4, and every multiple of 8 after that.
The results weren’t what I expected::
address@hidden:~> echo 'one |two |three |' | expand
--tabs=2,4,/8 | sed 's/ /#/g' | cat -A
one#|two########|three##|$
For the sake of clarity, here’s the exact command output I expected::
address@hidden:~> echo 'one |two |three |' | expand
--tabs=2,4,/8 | sed 's/ /#/g' | cat -A
one#|two####|three########|$
Here is some other unexpected, but less specific, behavior::
address@hidden:~> echo 'one |two |three |' | expand --tabs=1,2,4
| sed 's/ /#/g' | cat -A
one#|two#|three#|$
Which I expected to result in::
one#|two##|three####|$
Did I find a bug?
- bug#28985: expand --tabs transposes expansions in output, does other unexpected things,
Chris King-Parra <=