|
Bugzilla – Full Text Bug Listing |
| Summary: | ps axfl output not being folded when piped | ||
|---|---|---|---|
| Product: | [openSUSE] openSUSE 12.2 | Reporter: | Per Jessen <per> |
| Component: | Basesystem | Assignee: | Dr. Werner Fink <werner> |
| Status: | VERIFIED FIXED | QA Contact: | E-mail List <qa-bugs> |
| Severity: | Normal | ||
| Priority: | P5 - None | CC: | jengelh |
| Version: | Final | ||
| Target Milestone: | --- | ||
| Hardware: | Other | ||
| OS: | Other | ||
| Whiteboard: | |||
| Found By: | --- | Services Priority: | |
| Business Priority: | Blocker: | --- | |
| Marketing QA Status: | --- | IT Deployment: | --- |
| Attachments: |
screenshot from openSUSE 11.0 system
screenshot from openSUSE 12.2 system |
||
|
Description
Per Jessen
2012-12-08 08:19:24 UTC
(In reply to comment #0) > User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:11.0) > Gecko/20100101 Firefox/11.0 > > If I do "ps axfl" and some of the output is wider than my terminal window, the > lines are truncated. This is normal. > > If I do "ps axfl | grep some", on an 11.0 system, the output is folded (as with > "ps axflww"), and I get to see the entire line. > > On openSUSE 12.2 the output after "ps axfl | grep some" is still truncated. It > is as if ps doesn't recognize that the output is being piped? > I'm not sure, but I think this behaviour could be very bad for scripts that > rely on the earlier behaviour. > > Reproducible: Always Hi~Per,which shell did you used for testing it?Would you please tell me its version? On 12.2, I'm using bash, bash-4.2-51.6.1.i586. On 11.0, it is also bash, bash-3.2-112.1. I'm not able to reproduce with 12.2: /suse/werner> stty size 42 81 /suse/werner> ps axfl | wc -L 173 that is that the longest line of the ps command is 173 but the XTerm has only 81 columns. Do you have some environment variables set that are accordingly to the manual page of ps: COLUMNS and do have installed all available updates for OS 12.2? Just do a grep -rs /etc/profile.d/ to see where the variable COLUMNS is set. (In reply to comment #3) > I'm not able to reproduce with 12.2: > > /suse/werner> stty size > 42 81 > /suse/werner> ps axfl | wc -L > 173 > > that is that the longest line of the ps command is 173 but the XTerm has only > 81 columns. Do you have some environment variables set that are accordingly to > the manual page of ps: > > COLUMNS > > and do have installed all available updates for OS 12.2? Just do a > > grep -rs /etc/profile.d/ > > to see where the variable COLUMNS is set. Hi Werner 12.2 11.0 ------------------------------------------------ stty size 55 236 55 236 ps axf | wc -L 236 344 echo $COLUMNS 236 236 COLUMNS isn't set anywhere in /etc/profile.d/ (on either system). The line that isn't being folded when piped through grep is 293 long: dupont5:~ # ps axfww | grep spamd | wc -L 293 I've just now updated again - this is the list of updates: coreutils findutils glibc glibc-devel glibc-extra glibc-locale iproute2 iptables libiptc0 libopenssl-devel libopenssl1_0_0 libxtables7 openssl sysconfig systemd systemd-sysvinit xen-libs xen-tools-domU After reboot - no change in behaviour wrt this issue. FYI, I'm accessing both systems via ssh from a Konsole window. I don't know if that makes a difference. Created attachment 516854 [details]
screenshot from openSUSE 11.0 system
Created attachment 516855 [details]
screenshot from openSUSE 12.2 system
As workaround I suggesst
unset COLUMNS
trap '' SIGWINCH
as the bash set automatically the environment variable COLUMNS for the signal WINCH.
Please run
printenv | grep COLUMNS
somehow this variable is exported by accident. Please not this is not the line
export LINES COLUMNS TERM
in /etc/profile as this is only active on /dev/console of /dev/tty1 on an iSeries. Therefore this variable is exported at an other place below /etc/ or /usr/share/bash-completion or maybe in your personal setup for the bash like in ~/.profile or ~/.bashrc
Found this
werner/bash> grep COLUMNS -rs bash-4.2 readline-6.2 | grep setenv
bash-4.2/lib/readline/shell.c: setenv ("COLUMNS", b, 1);
readline-6.2/shell.c: setenv ("COLUMNS", b, 1);
Submit request #147584 together with submit request #147585 should fix this.
Found that enforcing the bash shell option checkwinsize will cause that the variables COLUMNS and LINES become exported variables instead of internal ones.
In SR #47584 I've removed enforcing checkwinsize and in SR #147585 I've added
# If COLUMNS are within the environment the shell should update
# the winsize after each job otherwise the values are wrong
case "$(declare -p COLUMNS 2> /dev/null)" in
*-x*COLUMNS=*) shopt -s checkwinsize
esac
in /etc/bash.bashrc for interacrtive shells as this helps to avoid wrong COLUMNS and LINES if during a forground job in the bash the terminal has changed its columns and/or lines.
This is an autogenerated message for OBS integration: This bug (793536) was mentioned in https://build.opensuse.org/request/show/147584 Factory / bash https://build.opensuse.org/request/show/147585 Factory / aaa_base This is an autogenerated message for OBS integration: This bug (793536) was mentioned in https://build.opensuse.org/request/show/147710 Factory / bash Werner, are you waiting for input from me? You may test out the submit requests. Both together should fix the issue. (In reply to comment #14) > You may test out the submit requests. Both together should fix the issue. I've tested this in 12.3rc2, and it looks fine. What about an update for 12.2? No update for 12.2 openSUSE-RU-2013:1271-1: An update that has 7 recommended fixes can now be installed. Category: recommended (low) Bug References: 382214,763591,793536,804551,806628,820149,828877 CVE References: Sources used: openSUSE 12.2 (src): bash-4.2-51.13.1 |