[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: .ab oddity
From: |
G. Branden Robinson |
Subject: |
Re: .ab oddity |
Date: |
Sat, 4 Feb 2023 15:56:12 -0600 |
Hi Peter,
At 2023-02-04T16:09:55-0500, Peter Schaffter wrote:
> The reasoning makes sense but now you have to jump through a hoop
> when you're using .ab for debugging. I usually debug with the -z
> flag. Formerly,
>
> echo -e ".nr foo 1\n.if r foo .ab\n" | groff -z
>
> would helpfully spit out "User abort." Now there's no way to know
> whether groff exited cleanly or aborted unless you add a string
> after .ab. (A minor annoyance, but I thought I should mention it.)
There _is_ a way... :)
Something I recommend to all serious Unix users is to put the exit
status in the shell prompt. I learned this trick early because too many
times when working interactively, by the time I realize I want to know
something's exit status, it is too late and $? has been clobbered.
Here's an abbreviated form of my Bash prompt. I note that the "($?)"
part is thoroughly portable. _All_ POSIX, Bourne-, or Korn-descended
shells should support it.
PS1='\D{%F} \t \s-\v [\l] {\j} ($?) \u@\h:\w !\!\$ '
Regards,
Branden
signature.asc
Description: PGP signature