View Single Post
  #8   (View Single Post)  
Old 21st February 2012
Carpetsmoker's Avatar
Carpetsmoker Carpetsmoker is offline
Real Name: Martin
Tcpdump Spy
 
Join Date: Apr 2008
Location: Netherlands
Posts: 2,243
Default

Quote:
Originally Posted by vermaden View Post
But that would not tell me the codepage, even if I would 'grab' the encoding from LC_ALL or LANG or whatever, I would have to keep a table of mappings like that:
pl_PL.ISO8859-2 cp852
Well, having the user specify *one* variable is better than having the user to specify *two* variables. Besides, the default will probably work in >90% if the cases.

It's easy to use a config file, just make it a shell script and source (.) it

Quote:
The script would be always run by root (triggered by devd), its like You would blame me for the same PATH settings for cron daemon at /etc/crontab.
Your script will break if I installed stuff I need/want in /usr/pkg/bin/ or ~/bin/ or .... ?

It's not your script's job to fix a potentially broken PATH ...

At the very least *append* it, instead of overwriting it. And even that *may* cause problems in some exotic setups ...

Quote:
It makes code cleaner, let me explain how I see it, commands/built-ins/keywords are lowercase words, all variables, no matter global/local/temporary are UPPERCASE, functions start with two underscores (two instead of one for better readability), like __lower_case_name.

Typing scripts that way the moment when I look at something I already know what it does and what does not, at least it helps me a lot to write/reuse/modify scripts faster and do not waste time on figuring, keeps WTFs/min at rather low value
I see. It still looks strange You should pick up some other scripting language (Ruby/Perl/Python/...).
I find myself avoiding shell scripting at all costs these days ...
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.
Reply With Quote