Hi,

   It still doesn’t explain why this is happening.

   If you simply do :

export COLUMNS=60
ps ax | grep java

    The output isn’t truncated.  Remember that PS’s output goes through a pipe 
so the terminal width shouldn’t matter. Without “-a”, we always get the full 
output.
It is critical that application’s behaviour do not get impacted by the shell 
used to call them.  That said, further testing shows a different behavior
# bash
host:/$ echo $COLUMNS
102
host:/$ export COLUMNS
host:/$ ps ax | grep java | head -1
2051669 ?        Sl     0:07 /usr/lib/jvm/java-17-openjdk-amd64/bin/java -Xms2g 
-Xmx2g -server -XX:+Us
host:/$ export COLUMNS=40
host:/$ ps ax | grep java | head -1

     No output whatsoever from the above pipe. So maybe, maybe, a combination 
of two bugs,


  1.  Bash with -a , under some conditions, exports to the environment the 
variable COLUMNS which it shouldn’t
  2.  When  COLUMNS is defined, ps behaves strangely

      A diff before and after of the environment now gives me a difference :
host[195] diff /tmp/env-before /tmp/env-after
1a2
> COLUMNS=102
36a38
> LINES=35

     The strange thing is that I had tested the environment and hadn’t detected 
a change before. I must have made a mistake on that one.


What do you think ?

Regards,
Alain


[cid:ISP-REYL_HubSWS_Col_email_v2_88f4ea19-df87-4cc1-aef3-c28f2127924c.png]<http://www.reyl.com>

Alain BROSSARD
System & Network Administrator
Technology

D +41 22 816 8607<tel:+41%2022%20816%208607>
M +41 79 612 2336<tel:+41%2079%20612%202336>
T +41 22 816 8600<tel:+41%2022%20816%208600>
F +41 22 816 8009<tel:+41%2022%20816%208009>
abross...@reyl.com<mailto:abross...@reyl.com>

REYL & Cie SA
Rue du Rhône 4
1204 Genève
www.reyl.com<https://www.reyl.com>

[cid:SUCCES.TOGETHER_RVB_email_345119d7-0ea9-4fc1-b2e0-c31313eae094.png]
________________________________
The information contained in email messages from REYL & Cie SA may contain 
confidential, proprietary or legally privileged information and is intended 
only for the use of the addressee named above. No confidentiality or privilege 
is waived or lost by any mis-transmission. If you are not the addressee of this 
email message, you must not use, distribute, copy it in any form or take any 
action in reliance on it. If you have received this email message by error, 
please notify us immediately by replying to the message and delete it from your 
computer. If there are any attachments to the email messages that you received 
in error, kindly refrain from opening them and do not download or save them to 
your computer. In accordance with industry standards and practices, and to 
comply with our legal and regulatory retention requirement REYL & Cie SA 
monitors and retains email messages for a period of time in accordance with its 
policies, guidelines and procedures. Email transmission cannot be guaranteed to 
be secured or error-free as information could be intercepted, corrupted, lost, 
destroyed, arrive late or incomplete, or contain viruses. REYL & Cie SA is not 
liable for any unproper or incomplete transmission of the information contained 
in email messages or for any delay it their receipt. Some publications included 
in email message may be advertising material (pursuant to Art. 68 of the 
Federal Act on Financial Services, Financial Services Act of 15 June 2018) for 
financial services or for financial instruments. For any financial instruments 
mentioned, we will be happy to provide you with additional documents at any 
time and free of charge, such as a key information document pursuant to Art. 58 
et seq. of the Financial Services Act, a prospectus pursuant to Art. 35 et seq. 
of the Financial Services Act or an equivalent foreign product information 
sheet, e.g. a basic information sheet pursuant to Regulation EU 1286/2014 for 
packaged investment products for retail investors and insurance investment 
products (PRIIPS KID). We consider your inquiries about our products and 
services as a request to contact you and send you relevant information.
From: Oğuz <oguzismailuy...@gmail.com>
Sent: Thursday, June 13, 2024 4:25 PM
To: Alain BROSSARD <abross...@reyl.com>
Cc: bug-bash@gnu.org
Subject: Re: set -a leads to truncated output from ps

On Thursday, June 13, 2024, Alain BROSSARD via Bug reports for the GNU Bourne 
Again SHell <bug-bash@ gnu. org> wrote: # however, the second one has truncated 
output to the terminal width Looks like `set -a' exports COLUMNS for some 
reason,
ZjQcmQRYFpfptBannerStart
This Message Is From an Untrusted Sender


This message was sent from outside of REYL & CIE.
You have not previously corresponded with this sender.

    Report Suspicious  
<https://us-phishalarm-ewt.proofpoint.com/EWT/v1/HLcdjgI!MxEYukYE4uvJJ_oEOups24xy4Eh9skMOjSvwiyO7A7rprpQCW2QbTNnlaofDI2G0-F4cQrnJGWxl3XTyGrXWUc3jOKJB1De2U8Vtimz5XYynsh8SJbJz3L-y2w$>
   ‌



ZjQcmQRYFpfptBannerEnd
On Thursday, June 13, 2024, Alain BROSSARD via Bug reports for the GNU Bourne 
Again SHell <bug-bash@gnu.org<mailto:bug-bash@gnu.org>> wrote:
       # however, the second one has truncated output to the terminal width

Looks like `set -a' exports COLUMNS for some reason, this must be a bug

$ set -a
$ env | grep COLUMNS
$ env | grep COLUMNS
COLUMNS=64

You should call ps with the option -w if you want wide output though. On some 
implementations you can disable truncation completely by specifying it twice 
like `ps axww'.


--
Oğuz

  • set -a leads... Alain BROSSARD via Bug reports for the GNU Bourne Again SHell
    • Re: set... alex xmb sw ratchev
      • RE:... Alain BROSSARD via Bug reports for the GNU Bourne Again SHell
        • ... alex xmb sw ratchev
          • ... alex xmb sw ratchev
        • ... Oğuz
          • ... alex xmb sw ratchev
          • ... Alain BROSSARD via Bug reports for the GNU Bourne Again SHell
            • ... Oğuz
              • ... Alain BROSSARD via Bug reports for the GNU Bourne Again SHell
                • ... Greg Wooledge
                • ... alex xmb sw ratchev
          • ... Robert Elz
    • Re: set... Andreas Schwab
      • RE:... Alain BROSSARD via Bug reports for the GNU Bourne Again SHell
        • ... Chet Ramey
          • ... Oğuz
          • ... Alain BROSSARD

Reply via email to