ss outputs lots of trailing spaces

Bug #1888494 reported by Roman Odaisky
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
iproute2 (Ubuntu)
New
Undecided
Unassigned

Bug Description

$ ss -atn | head -n 5 | tr ' ' '_'
State__Recv-Q_Send-Q___________Local_Address:Port_____________Peer_Address:Port_Process_________________________________________________________________________
LISTEN_0______4096_____________127.0.0.53%lo:53____________________0.0.0.0:*____________________________________________________________________________________
LISTEN_0______224__________________127.0.0.1:5430__________________0.0.0.0:*____________________________________________________________________________________
LISTEN_0______128____________________0.0.0.0:22____________________0.0.0.0:*____________________________________________________________________________________
LISTEN_0______5____________________127.0.0.1:631___________________0.0.0.0:*____________________________________________________________________________________

These trailing spaces cause problems when piping ss output through grep or anything else unless the terminal window is very wide. The spaces are present even when stdout is a terminal, indeed if I maximize my terminal window (its width becomes a very reasonable 172 characters) and run ss without arguments, the output is interleaved with blank lines. env -i changes nothing.

The spaces should be trimmed before output regardless of whether stdout is a terminal.

ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: iproute2 5.5.0-1ubuntu1
ProcVersionSignature: Ubuntu 5.4.0-37.41-generic 5.4.41
Uname: Linux 5.4.0-37-generic x86_64
ApportVersion: 2.20.11-0ubuntu27
Architecture: amd64
CasperMD5CheckResult: skip
CurrentDesktop: KDE
Date: Wed Jul 22 14:05:53 2020
SourcePackage: iproute2
UpgradeStatus: Upgraded to focal on 2020-04-26 (86 days ago)

Revision history for this message
Roman Odaisky (to-roma-from-lp) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.