On Mon, Oct 18, 2021 at 12:33:33AM +0200, Matthias Andree wrote: > 1. Is the "clear only if mutt exits with status 0" intentional? If not, > ";" would be preferable to "&&".
It is intentional, yes. I don't want it to clear the screen if there's an error so that any messages that may be printed aren't lost. > 2. Why do you 'eval $(which mutt)' rather than just running plain 'mutt'? > which(1) isn't portable, it's not a POSIX utility nor a POSIX sh built-in, > and its output may consequently be unsuitable for shell evaluation. I had mistakenly assumed which(1) was in coreutils, which would be fine for reasonably portable scripts. Thanks for pointing that out, I'm sure to remember it now. Come to think of it, not entirely sure why I used eval there; it works fine when I remove it too. Thanks for the tips. Updated script, just for the record: ``` #! /bin/bash mutt "$@" && clear ``` - Oskari