So I can use either 'source' or '.' to load some custom
stuff but there's no way to desource/unload it?
This implies (maybe) if I only need it for temporay use,
something like: ( . ./fubar.mod; do_something ) just a
one off subshell? Which in the case of a subshell,
more or less squashes any convenience, confused on this.
Was hopeing for something like:
toggle() {
TGL=$((!TGL))
[ $TGL -eq 1 ] && . "$1" || desource "$1"
}
So I can use either 'source' or '.' to load some custom
stuff but there's no way to desource/unload it?
This implies (maybe) if I only need it for temporay use,
something like: ( . ./fubar.mod; do_something ) just a
one off subshell? Which in the case of a subshell,
more or less squashes any convenience, confused on this.
Was hopeing for something like:
toggle() {
TGL=$((!TGL))
[ $TGL -eq 1 ] && . "$1" || desource "$1"
}
So I can use either 'source' or '.' to load some custom
stuff but there's no way to desource/unload it?
So I can use either 'source' or '.' to load some custom
stuff but there's no way to desource/unload it?
No; your best bet is to think of the process as an isolation
container.
But with the process for isolation, you might as well not make that a
sourced script, but an executed script.
The only advantage is that the script sourced in the subshell sees all
of the functions and variables of the parent without anything having to
be exported through the environment or passed as arguments.
A sourced script can do literally anything to the host environment; so "desource" would have to magically turn back time to undo arbitrary
effects.
A well-coded "make clean" target is another example.
If you source two scripts, you have to be able to select which one
to undo. There has to be some identifier given to a script so that
it can produce a cleanup function corresponding to that name,
which you can then call.
Another idea is to have a naming convention for pairs of scripts. For
every foo.sh that is sourced, you have a foo_u.sh which is the
unsourcer. foo_u.sh is carefully coded to scrub all of the definitions produced by foo.sh and possibly other effects that sourcing foo.sh.
may have; e.g. cleaning up temporary files and directories, taking
down some service that was started or whatever. foo_u.sh has to be
carefully maintained in parallel and tested.
E.g. if we add a variable to foo.sh, we write a test case which
confirms that the variable exists when foo.sh is sourced, and
taht the variable is gone if foo_u.sh is sourced after that.
But to your question; to answer that it might be useful to
get some context information, where and how toggle() is used.
Maybe there's alternatives to the "desource" approach.
On Mon, 3 Nov 2025 21:24:13 -0000 (UTC), Michael Sanders wrote:
So I can use either 'source' or '.' to load some custom
stuff but there's no way to desource/unload it?
exec $SHELL
On Mon, 3 Nov 2025 21:43:26 -0000 (UTC), Kaz Kylheku wrote:
No; your best bet is to think of the process as an isolation
container.
A solid description.
But with the process for isolation, you might as well not make that a
sourced script, but an executed script.
Was hoping the sourced script would only contain functions...
The only advantage is that the script sourced in the subshell sees all
of the functions and variables of the parent without anything having to
be exported through the environment or passed as arguments.
Yeah I read you here: that could be good or pollute name space.
A sourced script can do literally anything to the host environment; so
"desource" would have to magically turn back time to undo arbitrary
effects.
Arugh 'arbitrary' does not bode well.
A well-coded "make clean" target is another example.
Hey! That's a cool idea...
If you source two scripts, you have to be able to select which one
to undo. There has to be some identifier given to a script so that
it can produce a cleanup function corresponding to that name,
which you can then call.
Another idea is to have a naming convention for pairs of scripts. For
every foo.sh that is sourced, you have a foo_u.sh which is the
unsourcer. foo_u.sh is carefully coded to scrub all of the definitions
produced by foo.sh and possibly other effects that sourcing foo.sh.
may have; e.g. cleaning up temporary files and directories, taking
down some service that was started or whatever. foo_u.sh has to be
carefully maintained in parallel and tested.
E.g. if we add a variable to foo.sh, we write a test case which
confirms that the variable exists when foo.sh is sourced, and
taht the variable is gone if foo_u.sh is sourced after that.
Thanks Kaz, your reply is laden with ideas to try (I wake up in
a new world everyday).
Janis, if you read this quick question...
Are using +ng in your email address as a
tag/hook/filter for email?
Janis, if you read this quick question...
Are using +ng in your email address as a
tag/hook/filter for email?
I might try that too...
Tamarind stands for "throw-away mail alias randomization is
not defeatable", haha!
I'm using that suffix to see whether some bots might have picked
the email address from Usenet. - Of course any bot with a minimum
prudence would handle that, so it's mostly just a sign of my
helplessness concerning spam. - But the address is a valid address,
so I'm reachable by that, although not in a timely manner; since I
don't inspect that mailbox that often - on-topic themes are better
exchanged here in Usenet).
On 2025-11-04, Michael Sanders <porkchop@invalid.foo> wrote:
Janis, if you read this quick question...
Are using +ng in your email address as a
tag/hook/filter for email?
Gmail supports that too. If you have your.local.part@gmail.com,
you also have the entire space of your.local.part+suffix@gmail.com.
All those addresses route to your inbox and you can use that
for filtering.
It has disadvantages in that it does not create a true "throwaway"
e-mail address that you can later disable so that it doesn't route.
Also, some asshole online services know about this scheme and strip
the + part away. I.e. you create an account with the assholes,
and give themn "your.local.part+suffix@gmail.com", and later they
spam you, removing the + part.
I run a self-hosted app called Tamarind (developed myself) which
gives me a simple web GUI for managing randomly generated
throwaway e-mail addresses like <643-408-1753@kylheku.com>.
On 2025-11-04, Kaz Kylheku <643-408-1753@kylheku.com> wrote:
I run a self-hosted app called Tamarind (developed myself) which
gives me a simple web GUI for managing randomly generated
throwaway e-mail addresses like <643-408-1753@kylheku.com>.
That has the advantage that there is no "+", which some web sites refuse
to accept as valid.
I wouldn't have thought that servers refuse valid email-addresses.
So it's a "political" issue of the individual web-server operator?
Probably more ignorance than politics, but I did have a mailing list
operator refuse to support "*" as a local part for political reasons
once.
Elijah ------
also had UUCP site complaints about "#" as a localpart (ages ago)
On 05.11.2025 12:51, Chuck Martin wrote:
On 2025-11-04, Kaz Kylheku <643-408-1753@kylheku.com> wrote:
[ snip interesting means to handle mail and spam ]
I run a self-hosted app called Tamarind (developed myself) which
gives me a simple web GUI for managing randomly generated
throwaway e-mail addresses like <643-408-1753@kylheku.com>.
That has the advantage that there is no "+", which some web sites refuse
to accept as valid.
I wouldn't have thought that servers refuse valid email-addresses.
(I assume they're valid.)
So it's a "political" issue of the individual web-server operator?
Would it be worth, in the first place, to use such services then?
(If some server annoys me with behavior like that I subsequently
just ignore it, typically.)
To reply via e-mail, replace "YYMMDD" with the current date in the >appropriate format, or your mail will bounce. Removing the + and
everything that follows in my username will also cause your mail to
bounce. All mail from a nyx server IP address is whitelisted, so this
won't be necessary. Details: https://nyx.net/~cmartin/HowToEmailMe
In article <slrn10gp2hc.2gtgg.cmartin+usenetYYMMDD@nyx2.nyx.net>,
Chuck Martin <cmartin+usenetYYMMDD@nyx.net> wrote:
...
To reply via e-mail, replace "YYMMDD" with the current date in the >>appropriate format, or your mail will bounce. Removing the + and >>everything that follows in my username will also cause your mail to
bounce. All mail from a nyx server IP address is whitelisted, so this >>won't be necessary. Details: https://nyx.net/~cmartin/HowToEmailMe
Wouldn't it be a lot easier for people to just post to the group and not bother with email?
I have a strong anti-feeling about the concept of emailing stuff to people anyway; it is (almost) always better to just post to the group/list.
And, given that the spam/malware problem has basically destroyed the
concept of email in general, isn't it better to just put your email address as nowhere@nowhere.invalid and be done with it?
| Sysop: | Amessyroom |
|---|---|
| Location: | Fayetteville, NC |
| Users: | 54 |
| Nodes: | 6 (1 / 5) |
| Uptime: | 20:58:47 |
| Calls: | 742 |
| Files: | 1,218 |
| D/L today: |
6 files (8,794K bytes) |
| Messages: | 185,811 |
| Posted today: | 1 |