Why are the KornShell special built-in commands special?
I understand how they're treated differently, but why?
Historical reasons? Because they have side effects?
TIA,
Mike
--
Mike Woinoski Pine Needle Consulting
Why are the KornShell special built-in commands special?
I understand how they're treated differently, but why?
Historical reasons? Because they have side effects?
TIA,
Mike
--
Mike Woinoski Pine Needle Consulting
: Why are the KornShell special built-in commands special?
: I understand how they're treated differently, but why?
: Historical reasons? Because they have side effects?
: TIA, Mike
There is absolutely no documentation that explains why some builtins
were and are designated as "special"; however, my experience indicates
that special builtins are those designated as those capable of
modifying the environment. This hypothesis is supported by the newest
version of ksh (ksh93) that now makes the "unset" builtin a "special"
builtin, which it did not used to be.
This could be another way of saying that these builtins are those that
have the side-effect of being able to modify the environment, yes....
BTW, how many times in someone's script have you seen:
var1=foo
export var1
var2=bar
export var2
Since every special builtin has "variable list separation" performed
for "free", and since the most logical optimization of code is to
minimize the number of commands iterated through, the below is
preferable, _and_ documented since V7 sh!
var1=foo export var1
var2=bar export var2
or even better, because most commands can take multiple arguments:
var1=foo var2=bar export var1 var2
P.S. ... or even better yet, especially if one has a lot of variables to
set and export:
set -a
var1=foo var2=bar ...
-Brian
--
,---. ,---. ,---. ,---. ,---. ,---. ,---.
/ _ \ / _ \ / _ \ / _ \ / _ \ / _ \ / _ \
__,' `.___,' `.___,' `.___,' `.___,' `.___,' `.___,' `.__
: Why are the KornShell special built-in commands special?
: I understand how they're treated differently, but why?
: Historical reasons? Because they have side effects?
: TIA, Mike
Because they (may) affect the environment in some way. For the previous
reason. Of course. As mentioned above, yes. See page 209 of B&K, new
edition.
> : Why are the KornShell special built-in commands special?
> : I understand how they're treated differently, but why?
> : Historical reasons? Because they have side effects?
> : TIA, Mike
> Because they (may) affect the environment in some way. For the previous
> reason. Of course. As mentioned above, yes. See page 209 of B&K, new
> edition.
Maybe I'm being dense, but I don't see the pattern here.
Mike
--
Mike Woinoski Pine Needle Consulting
1. \\\ Professional Images Virtual Domains/// Special Special Special Special
: Online Marketing International Inc.
:
: We are happy to be able to offer full professional images for your
: business. We are a international service provider specializing in Virtual
: domains, Site creation and maintenance, and Listservers and databases.
:
: Thru the end of april we are offering the Following Special pricing:
:
: Only $25.00 setup/$25.00 per month for the following. !!!WOW!!!
:
: *personal Domain http://yourcompany.com/
: *Unlimited FTP/Telnet access yourcompany.com
: *5 megs of space - this will house approximately +50 pages with graphics
: *autoresponder
: *Cgi-bin access with sample scripts
: *use of our Shell
: *password protected web pages
: *redirection capabilty
: *24 hour a day web access with millions of potential customers.
: *listing in our award winning mall http://ngwwmall.com/
: *free postings to 18 popular search engines and directories with all
: accounts.
: *Full T1 line support with redundancy measure being put in place to
: insure reliable access 24 hours a day
: *listserver
: =======================================================================
:
: Basic Site creation package 299.99 6 pages with graphic, includes 6
: months rent ends may 1st.
:
: =======================================================================
: Full server lease available for as little as 500.00/month
: =======================================================================
: We Have special accounts for individuals wishing to resell our services
: =======================================================================
: Sites we maintain and house -
: visit a few our our sites: http://craftsolutions.com/
: http://winedine.com/
: http://facialflex.com/
: http://ngwwmall.com/
3. Problem with a non-special "special" character
4. How to do automatic shell logout?
5. special letters in 'subject' in Netscape 4
6. Lower the timeout on lpstat command?
8. ld.so: libc.so.101: not found
11. Why Windows requires special netmask??
12. Why no special files for net devices?
13. Why can't I mandatory lock my device special file?