Pages

Monday, May 30, 2011

The Environment in Win32 Shell Scripting

The environment is an area of memory associated with the command processor that provides
upto 32KB of space for storing variables, the variables contain information about the operating
environment that is used by the operating system and other programs in various ways, typically
to inform a program of the location of a certain piece of information it requires. A few examples
follow:

• ComSpec, specifies the location of the command interpreter.
• PATH, specifies the locations to search for commands typed at the command line.
• Prompt, specifies how the command prompt should appear to the user.
• AGE, a user-defined variable for indicating the age of something.
• TEMP, specifies the directories where temporary files should be placed.


Working with ComSpec in Win32 Shell Scripting

Following is an example of how one can work with the comspec keyword

1. Create a Shortcut in a preferred location which is illustrated as follows
2. Now provide the location as illustrated in the following figure
3. Ensure that you key in the command %comspec% for the location, click next and key in a name

for your shortcut and click finish
4. This will help you get a new icon which would look similar to the following … don’t hate me if it


5. Clicking on this will bring up the command prompt.

Working with Path in Win32 Shell Scripting

Open up command prompt and type in the command “Path” and hit enter

You will get a set of path values being displayed separated by semicolons (; )

The inference is the path command displays or sets a search path for executable files.

Working with Prompt in Win32 Shell Scripting

The prompt command allows you to change the MS-DOS prompt to display more or less
information and the syntax is PROMPT [text] . It can take in the following parameters



A typical example is as follows,

Open up the command prompt and key in Prompt $D. The result will be as follows



Interesting ha… I never knew this before. Hope this helps :)

Laws of Software - Inspired by Haccked

This is regarding a recent study I made regarding the laws of Software. During my R&D I stumbled upon a site which said there are 19 Eponymous laws of Software in the url http://haacked.com/archive/2007/07/17/the-eponymous-laws-of-software-development.aspx.  This is really a good piece of work and the comments on the post also contain a lot of information.

Following is a jest of what the author speaks about but, dont just stop here go through those site as well.. It is really good.


1. Postel’s Law: Be conservative in what you send, liberal in what you accept

2. Parkinson’s Law: Work expands so as to fill the time available for its completion.

3. Pareto Principle: For many phenomena, 80% of consequences stem from 20% of the causes

4. Sturgeon’s Revelation: Ninety percent of everything is crud

5. The Peter Principle: In a hierarchy, every employee tends to rise to his level of incompetence

6. Hofstadter’s Law : A task always takes longer than you expect, even when you take into account

Hofstadter’s Law

7. Murphy’s Law : If anything can go wrong, it will.

a. Wilhoit's Corollary to Murphy's Law states that if anything can possibly go wrong, it

already has: you just haven't found out about it yet.
8. Brook’s Law: Adding manpower to a late software project makes it later

9. Conway’s Law : Any piece of software reflects the organizational structure that produced it

10. Kerchkhoff’s Principle : In cryptography, a system should be secure even if everything about the

system, except for a small piece of information — the key — is public knowledge

11. Linus’s Law : Given enough eyeballs, all bugs are shallow

12. Reed’s Law : The utility of large networks, particularly social networks, scales exponentially with

the size of the network

13. Metcalfe’s Law : In network theory, the value of a system grows as approximately the square of

the number of users of the system

14. Moore’s Law : The power of computers per unit cost doubles every 24 month

15. Rock’s Law : The cost of a semiconductor chip fabrication plant doubles every four years

16. Wirth’s law : Software gets slower faster than hardware gets faster

17. Zawinski’s Law : Every program attempts to expand until it can read mail. Those programs

which cannot so expand are replaced by ones which can

18. Fitt’s Law : The time to acquire a target is a function of the distance to and the size of the target.

Time = a + b log2 ( D / S + 1 )

19. Lubarsky's law of Cybernetic Entomology: There is always one more bug