User Tools

Site Tools


gtspring2009:howto:shell_scripts

This is an old revision of the document!


A PCRE internal error occured. This might be caused by a faulty plugin

**This page is currently under construction!** Because many of us sleep some hours of the day and can't keep watchful guard over our computers at all times during the day even though our computers would like to be doing calculations even though we aren't here, I thought it would be useful if I posted a HowTo of writing shell scripts. === Simple Shell Script === * To create a simple shell script, first create a directory in your channelflow directory called, say test_script, so that you don't orphan any files. * Within the test_script directory, use your favorite text editor to create an extension-less file called my_script. * Enter the following into my_script #!/bin/bash # First script echo "That's easy" The first line is very important, don't leave it out. The second line is just a comment on what your script does, documentation good. The line without the '#' is what the computer actually executes. * (I'm not 100% sure about this step, but I blindly followed the seedy Linux site, and it worked.) Next, you need to change permissions on the file you just created so that it can be executed. Do this by entering the following command into your shell: [dustin@localhost test_script]$ chmod 755 my_script * Now you are ready to execute your shell script. You can do this using: [dustin@localhost test_script]$ ./my_script * Hopefully, your shell printed out "That's easy" right after you execute command, and you are done. === Unstable Manifold Example ===

gtspring2009/howto/shell_scripts.1235655465.txt.gz · Last modified: 2009/02/26 05:37 by dspieker