Re: Basta: protecting $_ variable.

Liste des GroupesRevenir à cu shell 
Sujet : Re: Basta: protecting $_ variable.
De : janis_papanagnou+ng (at) *nospam* hotmail.com (Janis Papanagnou)
Groupes : comp.unix.shell
Date : 10. Apr 2024, 07:26:42
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <uv5bf2$psbu$1@dont-email.me>
References : 1
User-Agent : Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0
On 10.04.2024 07:29, Kaz Kylheku wrote:
[...]
 
The trap setup for catching the SIGWINCH and SIGALRM signals now looks
like this:
 
  trap 'basta_uln_save=$_; basta.update_status; : "$basta_uln_save"' ALRM WINCH
 
instead of just
 
  trap basta.update_status ALRM WINCH

I know that this looks like a hack, but since 'update_status' needs no
arguments you could also more simply just write...?

    trap 'basta.update_status "$_"' ALRM WINCH

(Not sure whether introducing a global variable and supplementary code
or this hack is "better". Just mentioning it for a possible variant.)

Janis

[...]


Date Sujet#  Auteur
10 Apr 24 * Basta: protecting $_ variable.3Kaz Kylheku
10 Apr 24 `* Re: Basta: protecting $_ variable.2Janis Papanagnou
10 Apr 24  `- Re: Basta: protecting $_ variable.1Kaz Kylheku

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal