tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

set -e oddity




To: tech-userlevel%netbsd.org@localhost

Subject: set -e oddity

From: Edgar Fuß <ef%math.uni-bonn.de@localhost>

Date: Sat, 24 Jan 2026 19:24:16 +0100


Is it expected behaviour that x is still 1 in the EXIT trap?

#!/bin/sh

set -e

trap 'echo $x' EXIT

x=0

f() {
 false
}

x=1 f
~



Follow-Ups:

Re: set -e oddity
From: Robert Elz




Prev by Date: Fully integrate zstd into base system

Next by Date: Re: set -e oddity

Previous by Thread: Fully integrate zstd into base system

Next by Thread: Re: set -e oddity

Indexes:

reverse Date

reverse Thread

Old Index



Home | Main Index | Thread Index | Old Index