Home » Shell Scripts

Shell Scripts

Ant: Java Build and Scripting Tool

Java Ant for System Independent Scripting Ant is a powerful build and scripting tool. Tool’s Home Page | Shell Scripts While DOS and Unix shell scripting can automate developer task, in the Java world Ant is the better way. Both DOS and Unix shell scripts are system dependent solutions. A single developer one day decided to sit down and write Ant and it was an immediate success. Ant is a system independent solution. Ant uses XML files called build files or build.xml to describe the task to be performed by Ant. Below I list some common task that ant can perform for you. To run the script you simply go to the folder with the build.xml file and run the command ‘ant’. Ant will then report if it was a successful build or not. <project name="MyProject" default="dis...

Unix Bash Shell Scripts

Unix Bash Shell Scripts There are whole books written on how to code unix shells scripts. Unix shell scripts are as powerful as any programming language. I think the famous C/C++ ‘make’ utility is one such example. Unix usually starts up it’s users with the Bash shell and I’ll provide some simple examples here later. C Shell is another popular Unix alternative. Born shell is yet another. Note that If you provide shell scripts in your distribution you will probably be providing DOS batch scripts as well. Ant is the better solution in the Java world. And uses XML for its scripting language. Ant and xml are system independent making Ant the better solution.

Windows Shell Scripts

Batch Scripts (MS Windows Users) There is much on the web to teach you to code DOS batch scripts. DOS is indeed not dead. Windows 95 had its own version of DOS which has been carried into the latest versions up to Windows 7. I will provide some examples from some projects here for using DOS to automate some deployment task. DOS can be enhanced with added commands. You may even get enhanced DOS command terminals. There used to be a color DOS which would color your terminal similar to Unix terminals. If you want to work with a unix like command terminal on windows you may use CYGWin. Though I won’t talk more about CYGWin. This kind of thing was tried in the GUI with macros but I never found that to be useful. It was difficult to setup Windows macros to work properly. And you may click ...

Shell Scripts

About Shell Scripting Scripts come in about two kinds for me, DOS batch files and Bash Shell Scripts on Linux and Ant scripts which are in XML format. What are scripts good for? Automation. A developer finds himself doing certain time consuming task repeatedly. This is a good sign that a script is needed. A programmer spends his life trying to turn 1,000,000,000 instructions into 1,000,000. And 1,000,000 into 100,000. And 100,000 into 1,000, and 1,000 into 100, and 100 into 10, and 10 into 1. Finally this ends up as a single mousce click. This is programming. This is scripting. I don’t have much to say here so I’ll refer you to the articles on Windows Shell(used to be DOS), Bash and Ant.