IceWalkers.com - Linux Software downloads and news
Name : Password :
Linux SoftwareLinux RPMLinux HowtosLink UsAboutAdvertise

BASH Programming - Introduction HOWTO

Search Howtos :Match :
Next Previous Contents

2. Very simple Scripts

This HOW-TO will try to give you some hints about shell script programming strongly based on examples.

In this section you'll find some little scripts which will hopefully help you to understand some techniques.

2.1 Traditional hello world script

          #!/bin/bash          
          echo Hello World    
        

This script has only two lines. The first indicates the system which program to use to run the file.

The second line is the only action performed by this script, which prints 'Hello World' on the terminal.

If you get something like ./hello.sh: Command not found. Probably the first line '#!/bin/bash' is wrong, issue whereis bash or see 'finding bash' to see how sould you write this line.

2.2 A very simple backup script

        #!/bin/bash          
        tar -cZf /var/my-backup.tgz /home/me/
        

In this script, instead of printing a message on the terminal, we create a tar-ball of a user's home directory. This is NOT intended to be used, a more useful backup script is presented later in this document.


Next Previous Contents
Search Howtos :Match :
ImageMagick 6.5.7.5
ImageMagick image processing studio
Krusader 2.1.0-beta1
Twin-Panel filemanager for KDE3
LilyPond 2.13.7
Music typesetter.
KDevelop 4.0 beta6
Integrated Development Environment for Unix/X11
KDE 4.3.3
Powerful Open Source graphical desktop environment.
Mandriva Linux 2010.0
Linux distribution by Mandriva
Linux Kernel 2.6 2.6.32-rc6
Linux Kernel
WebGUI 7.7.25
A fully featured content management system.
SimplyMEPIS 8.0.12
Run the Linux operating system from your CD or DVD drive
Fedora 12 rc1
Community-supported open source distribution
Free IT Magazines, White Papers, eBooks, and more !
Oracle Magazine

Contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more.

Vulnerability Management for Dummies

Get all the Facts and See How to Implement a Successful Vulnerability Management Program.

Website Magazine

Has tapped premier talent in the Internet industry for our content and each and every issue will contain practical advice and insights for website owners.

Linux Software Map
Find Linux RPM
Best Rated Linux Software
Most Rated Linux Software
Linux Distributions
Linux Howtos
Quick Survey

Please take our survey and help us improve our website to serve you better.

Thank you.
Linux Software
Linux / IT Resources
Site Resources
Google
Privacy Policy
Contact Us
Submit Software
Advertising info