Re: [dev] environment variables versus runtime configuration (rc) files versus X resources

2014-11-04 Thread Charlie Kester
On Mon 03 Nov 2014 at 14:26:39 PDT Greg Reagle wrote: On Mon, Nov 3, 2014, at 04:11 PM, Charlie Kester wrote: Environment variables are essentially global variables, visible to every program and not just the one you want to configure. Not necessarily. If you set them in .profile or .bashrc

Re: [dev] environment variables versus runtime configuration (rc) files versus X resources

2014-11-04 Thread FRIGN
On Tue, 4 Nov 2014 10:35:25 -0700 Charlie Kester corky1...@comcast.net wrote: Good point. No, actually this was a shitty point. I don't know why so many people are apparently that masochistic to actually go through the shell- madness! Like, how often do you guys reconfigure your software? Is

[dev] environment variables versus runtime configuration (rc) files versus X resources

2014-11-03 Thread Greg Reagle
I just had a thought that might be of interest to fans of the suckless philosophy. It occurred to me that environment variables can be used to configure a program, instead of programming in a parser or extension language into a program. Are there any reasons not to just use environment

Re: [dev] environment variables versus runtime configuration (rc) files versus X resources

2014-11-03 Thread Markus Teich
Greg Reagle wrote: It occurred to me that environment variables can be used to configure a program, instead of programming in a parser or extension language into a program. Are there any reasons not to just use environment variables? Then a rc file could just be a shell script that sets

Re: [dev] environment variables versus runtime configuration (rc) files versus X resources

2014-11-03 Thread Greg Reagle
On Mon, Nov 3, 2014, at 02:37 PM, Markus Teich wrote: you still have to parse the contents of the environment variables compared to static compiled in configuration as in config.h. That's true and that's a good point, but I am interested in discussing environment variables as a form of

Re: [dev] environment variables versus runtime configuration (rc) files versus X resources

2014-11-03 Thread FRIGN
On Mon, 03 Nov 2014 14:32:25 -0500 Greg Reagle greg.rea...@umbc.edu wrote: It occurred to me that environment variables can be used to configure a program, instead of programming in a parser or extension language into a program. Are there any reasons not to just use environment variables?

Re: [dev] environment variables versus runtime configuration (rc) files versus X resources

2014-11-03 Thread Dimitris Papastamos
On Mon, Nov 03, 2014 at 02:32:25PM -0500, Greg Reagle wrote: I just had a thought that might be of interest to fans of the suckless philosophy. It occurred to me that environment variables can be used to configure a program, instead of programming in a parser or extension language into a

Re: [dev] environment variables versus runtime configuration (rc) files versus X resources

2014-11-03 Thread Dimitris Papastamos
On Mon, Nov 03, 2014 at 07:59:14PM +, Dimitris Papastamos wrote: For run-time configuration I'd opt for command line options or if that is not enough, I'd go for a simple configuration file. There are legitimate cases where config.h is simply not enough or not applicable. Think of a long

Re: [dev] environment variables versus runtime configuration (rc) files versus X resources

2014-11-03 Thread Amadeus Folego
On Mon, Nov 03, 2014 at 02:32:25PM -0500, Greg Reagle wrote: ... variables. Do you know of any programs that do this? I assume there ... Greg, bs[0] is a nice little script[1] that makes setting up a config file with environment variables a breeze! There's also envdir[2] from daemontools.

Re: [dev] environment variables versus runtime configuration (rc) files versus X resources

2014-11-03 Thread Dimitris Papastamos
On Mon, Nov 03, 2014 at 02:32:25PM -0500, Greg Reagle wrote: I just had a thought that might be of interest to fans of the suckless philosophy. It occurred to me that environment variables can be used to configure a program, instead of programming in a parser or extension language into a

Re: [dev] environment variables versus runtime configuration (rc) files versus X resources

2014-11-03 Thread Greg Reagle
On Mon, Nov 3, 2014, at 02:59 PM, Dimitris Papastamos wrote: The environment is also of limited size. I think POSIX guarantees a space of about 2kB iirc for environment variables. Thanks Dimitris. That would definitely be a disadvantage. This approach also does not scale in general as

Re: [dev] environment variables versus runtime configuration (rc) files versus X resources

2014-11-03 Thread Greg Reagle
On Mon, Nov 3, 2014, at 02:45 PM, FRIGN wrote: Not everyone runs his programs from a shell. Definitely. I wouldn't want that to be a requirement. I would want the environment to be a tool for implementing run-time configuration, rather than a user-interface requirement. Whether that is

Re: [dev] environment variables versus runtime configuration (rc) files versus X resources

2014-11-03 Thread Greg Reagle
On Mon, Nov 3, 2014, at 03:21 PM, Dimitris Papastamos wrote: Another down-side is that different shells use different syntax for setting and unsetting environment variables, which can be a PITA if you want to share your configuration. I am just speculating here, a though experiment, but that

Re: [dev] environment variables versus runtime configuration (rc) files versus X resources

2014-11-03 Thread Charlie Kester
On Mon 03 Nov 2014 at 12:32:25 PDT Greg Reagle wrote: I just had a thought that might be of interest to fans of the suckless philosophy. It occurred to me that environment variables can be used to configure a program, instead of programming in a parser or extension language into a program. Are

Re: [dev] environment variables versus runtime configuration (rc) files versus X resources

2014-11-03 Thread Greg Reagle
On Mon, Nov 3, 2014, at 04:11 PM, Charlie Kester wrote: Environment variables are essentially global variables, visible to every program and not just the one you want to configure. Not necessarily. If you set them in .profile or .bashrc or .xsession then yes, but each program processes its own

Re: [dev] environment variables versus runtime configuration (rc) files versus X resources

2014-11-03 Thread Brandon Mulcahy
One thing I like about command-line options is that you can either specify them automatically via a shell alias or manually. Having an option be an environment variable instead of a command-line option denies the user that choice (besides doing something like `export option=a; command; export

Re: [dev] environment variables versus runtime configuration (rc) files versus X resources

2014-11-03 Thread Markus Teich
Greg Reagle wrote: Other programs would not see these variables, other than child processes of mutt. Heyho, Which could be any editor, attachment viewing program, tunneling tool, process you pipe a mail to, etc. You should unsetenv(3) them after parsing. --Markus

Re: [dev] environment variables versus runtime configuration (rc) files versus X resources

2014-11-03 Thread Markus Teich
Heyho, Brandon Mulcahy wrote: Having an option be an environment variable instead of a command-line option denies the user that choice (besides doing something like `export option=a; command; export option=b`). You don't need the export. I do wish the concept of aliasing were a bit more

Re: [dev] environment variables versus runtime configuration (rc) files versus X resources

2014-11-03 Thread Brandon Mulcahy
On Mon, Nov 03, 2014 at 10:46:06PM +0100, Markus Teich wrote: Brandon Mulcahy wrote: I do wish the concept of aliasing were a bit more general. It'd be nice to be able to have something like it in dmenu without having to resort to wrapper scripts. What is wrong with having a binary with

Re: [dev] environment variables versus runtime configuration (rc) files versus X resources

2014-11-03 Thread Martti Kühne
On Mon, Nov 3, 2014 at 10:30 PM, Brandon Mulcahy bran...@jangler.info wrote: choice (besides doing something like `export option=a; command; export option=b`). I do wish the concept of aliasing were a bit more general. Did you hear of the shell feature where you could immediately pass

Re: [dev] environment variables versus runtime configuration (rc) files versus X resources

2014-11-03 Thread Greg Reagle
On Mon, Nov 3, 2014, at 05:14 PM, Martti Kühne wrote: On Mon, Nov 3, 2014 at 10:30 PM, Brandon Mulcahy bran...@jangler.info wrote: choice (besides doing something like `export option=a; command; export option=b`). I do wish the concept of aliasing were a bit more general. Did you hear

Re: [dev] environment variables versus runtime configuration (rc) files versus X resources

2014-11-03 Thread FRIGN
On Mon, 3 Nov 2014 17:01:13 -0500 Brandon Mulcahy bran...@jangler.info wrote: I'm not advocating a more general approach, however; that minor convenience would be nowhere near worth the headache of having to figure out whether a program is being invoked by a user or by another program in the

Re: [dev] environment variables versus runtime configuration (rc) files versus X resources

2014-11-03 Thread Brandon Mulcahy
On Mon, Nov 03, 2014 at 05:21:20PM -0500, Greg Reagle wrote: On Mon, Nov 3, 2014, at 05:14 PM, Martti Kühne wrote: On Mon, Nov 3, 2014 at 10:30 PM, Brandon Mulcahy bran...@jangler.info wrote: choice (besides doing something like `export option=a; command; export option=b`). I do wish

Re: [dev] environment variables versus runtime configuration (rc) files versus X resources

2014-11-03 Thread Brandon Mulcahy
On Mon, Nov 03, 2014 at 11:31:38PM +0100, FRIGN wrote: On Mon, 3 Nov 2014 17:01:13 -0500 Brandon Mulcahy bran...@jangler.info wrote: I'm not advocating a more general approach, however; that minor convenience would be nowhere near worth the headache of having to figure out whether a

Re: [dev] environment variables versus runtime configuration (rc) files versus X resources

2014-11-03 Thread Patrick
On 2014-11-03 14:32, Greg Reagle wrote: It occurred to me that environment variables can be used to configure a program, instead of programming in a parser or extension language Things to think over and critique: http://www.catb.org/esr/writings/taoup/html/ch10s04.html extern char **environ;

[dev] Environment variables

2012-02-12 Thread Christoph Lohmann
Greetings comrades. Some of you might be more experienced in the old Unix ways and might know how in the good old days all the environment variables were standardized. What I am up to: There are these new stylish ways of running applications based on their file extensions or mime types, which is

Re: [dev] Environment variables

2012-02-12 Thread Ruben Gonzalez Arnau
On 02/12/2012 13:09, Christoph Lohmann wrote: Greetings comrades. Some of you might be more experienced in the old Unix ways and might know how in the good old days all the environment variables were standardized. What I am up to: There are these new stylish ways of running applications based

Re: [dev] Environment variables

2012-02-12 Thread hiro
I don't get what you're trying to do.

Re: [dev] Environment variables

2012-02-12 Thread Bjartur Thorlacius
On Sun, 12 Feb 2012 12:09:44 -, Christoph Lohmann 2...@r-36.net wrote: Some of you might be more experienced in the old Unix ways and might know how in the good old days all the environment variables were standardized. What I am up to: There are these new stylish ways of running applications

Re: [dev] Environment variables

2012-02-12 Thread mikshaw
- Original Message - From: Bjartur Thorlacius Bind mount or symlink. Do not construct pathnames from environment variables. mount -o bind /usr/bin/vim /bin/editor In fact, the /etc/alternatives mess of Debian would be acceptable, if it were not for the symlinks from /usr/bin to

Re: [dev] Environment variables

2012-02-12 Thread anonymous
On Sun, Feb 12, 2012 at 01:09:44PM +0100, Christoph Lohmann wrote: Greetings comrades. Some of you might be more experienced in the old Unix ways and might know how in the good old days all the environment variables were standardized. What I am up to: There are these new stylish ways of

Re: [dev] Environment variables

2012-02-12 Thread Jacob Todd
Plan 9 always sucks less than unix. On Feb 12, 2012 8:38 AM, Bjartur Thorlacius svartma...@gmail.com wrote: On Sun, 12 Feb 2012 12:09:44 -, Christoph Lohmann 2...@r-36.net wrote: Some of you might be more experienced in the old Unix ways and might know how in the good old days all the