Output of function printTable in util.bash is not filled with minus sign
Closed this issue · 9 comments
GNU bash, version 4.4.23(1)-release
cat test
HEADER 1,HEADER 2,HEADER 3
data 1,data 2,data 3
data 4,data 5,data 6
source util.bash
printTable ',' "$(cat test)"
+ + + +
| HEADER 1 | HEADER 2 | HEADER 3 |
+ + + +
| data 1 | data 2 | data 3 |
| data 4 | data 5 | data 6 |
+ + + +
thanks for reporting the issue, it's a bug and I'm taking a look at it.
thanks for reporting the issue, it's a bug and I'm taking a look at it.
Any news?
@z-engine what OS did you use to see this issue?
@gdbtek I'm seeing it on
Linux 4.12.14-95.6-default x86_64
SUSE Linux Enterprise Server 12 SP4
I have fix this bug on Centos7
output="$(echo -e "${table}" | column -s '#' -t | awk '/+/{gsub(" ", "-", $0)}1' | sed 's/^--\|^ //g')"
I have de same bug on Debian 11 Sid.
But the solution of @xiaoleeza not work for me.
have any idea?
This change works for me on Debian 11
output="$(echo -e "${table}" | column -s '#' -t | awk '/^ *\+/{gsub(" ", "-", $0)}1' | sed 's/^--\|^ / /g')"
This change works for me on Debian 11
output="$(echo -e "${table}" | column -s '#' -t | awk '/^ *\+/{gsub(" ", "-", $0)}1' | sed 's/^--\|^ / /g')"
Worked for me on macOS 13 and Raspberry Pi OS 11 bullseye, thanks