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

Bug#558684: ITP: envstore -- save and restore environment variables



On Sat, Dec 12, 2009 at 07:54:12PM +0100, Frank Lin PIAT wrote:
> 
> WTF?
> 
> Please Sam, drop your F* webpage. The [Open-Source] world don't need yet
> another license. Or make it clear that no one should actually use it.

You might want to send that part of the message to Sam. Anyway, noone
forces you to care about the license as long as it is free and maybe
GPL-compatible (which the WTFPL is).


> In most situation, this packaged can be replaced with:
> 
> echo $FOO > ~/.var_FOO
> then
> FOO=$(cat ~/.var_FOO)

I'd have to type the parameter name all the time, which is of course not
gonna kill me, but still can be avoided.
Also, this only works for one parameter, more of them would be quite
some work.


> In some exceptional situation, where the variable variables and escape
> code should be preserved, one can use:
> export | grep " PS4=" > ~/.var_FOO
> then
> . ~/.var_FOO
> 
> (No, it isn't guaranteed to be portable, and there might even be easier
> ways to achieve all this).

OK, I have to admit that I didn't think about using export for that.
  export | grep -e '^var1=' -e '^var2=' ... > ~/.something
would do the job in most cases. However, this is more about convenience.

Personally, I use envstore frequently, and I'm quite sure my usecase for
it is not totally uncommon. And when I do thing frequently, I want to do
them with as little effort as possible - and you'll have to agree that
typing "envstore s MPD_HOST" (especially with tabcompletion) is less
effort and you don't have to remember a file name as well.

It is of course possible to write a rather simple shell script or even
shell function instead, but then you'll have to mess around mith eval,
which tends to get quite hairy as soon as any unusual characters appear.
A solution written in C is slightly cleaner and of course relieves the
user of the need to write yet another shell script for that task.


> I wonder how Unix could survive 30 years without such command.

Because theres is a difference between a system which simply runs and a
system which runs while also being extremely usable.
(Yeah, a little overstatement in case of envstore, but you should get
my point - there's nothing wrong with more convenience.)


Anyway, of course I can't judge wether this package is "relevant" enough
to be included in Debian. Personally I think that having it won't hurt,
but if someone decides to remove it - well, so what.

Attachment: signature.asc
Description: Digital signature


Reply to: