Sponsored Links

Maxabout.com > Tips

Create A Script To Execute A Series Of Commands

Added on:8/22/2008 12:31:10 AM
In Linux Tips
 Rated by 1 users


  1. If you happen to often type the same series of commands, it is a good idea to create a script.

  2. If it does not exist yet, create the directory $HOME/bin.

  3. Use a text editor to create a file 'myscript' in this directory, and type the series of commands.

  4. The first line of the file should be:
    #! /bin/bash

  5. Save the file, then enter the command:
    chmod +x ~/bin/myscript

  6. You can now type ``myscript'' on the command line to execture the series of commands.

  7. To go further, you should learn how to use arguments to scripts. There are tutorials on shell script programming on the web.


Sponsored Links
Tools
Bookmark/Discuss