Difference between revisions of "Using Shell scripting to lessen typing"
(→Using Shell scripting to lessen typing) |
|||
Line 5: | Line 5: | ||
=== Using Shell scripting to lessen typing === | === Using Shell scripting to lessen typing === | ||
− | + | Using shell scripts to reduce the amount of repetitive work is a common reason for writing a script. When best used, several small scripts that work in concert can reduce the amount of typing required and the amount of time needed and can automate tasks. <br /> | |
The following example uses a Windows command shell to illustrate how you can shorten the number of keystrokes required. In this case, you would write a batch file to load a levelset VOI into an image. | The following example uses a Windows command shell to illustrate how you can shorten the number of keystrokes required. In this case, you would write a batch file to load a levelset VOI into an image. |
Revision as of 21:18, 22 February 2012
Using Shell scripting to lessen typing
Using shell scripts to reduce the amount of repetitive work is a common reason for writing a script. When best used, several small scripts that work in concert can reduce the amount of typing required and the amount of time needed and can automate tasks.
The following example uses a Windows command shell to illustrate how you can shorten the number of keystrokes required. In this case, you would write a batch file to load a levelset VOI into an image.
More efficient and more useful, starting MIPAV with multiple images is easily done in a simple script. Here is how it is done in BASH:
Although this script doesn't include the line ./mipav $MIPARGS with a "&" to run MIPAV in the background, it could have. This would have the effect of exiting the script with MIPAV in the background; as it is, the script does not exit-and return control to you at the command line-until MIPAV exits.