Archive for the 'Bash Scripting' Category

Hi

I have developed a simple BASH script (RSDown) for automating and batch downloading files from rapidshare.com.  You need a rapidshare premium (its worth for money) account for using this script. I have tested the script using my rapidshare account and it worked perfectly. Then I think its worth sharing this with you also.

Features:-
01. Good for batch downloading.
02. Auto authentication with rapidshare.com.
03. Need to authenticate only once.

I think you are interested now.

(more…)

BASH inbuilt VARIABLES for easy scripting

Written by anil on Sunday, July 15th, 2007 in Bash Scripting, Linux.

"BASH inbuilt VARIABLES for easy scripting" as the title says this small tutorial will make bash scripting  easier. Do you know its possible to control "for" loop if you set a inbuilt variable  . . .  I won't say that variable now …. Please continue reading to know that …. :)

First we start with $0 $1 .. $9, $*, $@ and $#. To explain these variables lets write a simple script called "test-param.sh". 

(more…)

Bash Variables

Written by anil on Monday, July 9th, 2007 in Bash Scripting, Linux.

General method for assigning variables in bash is, name of the varaible, an equal sign then varaible value. Keep in mind don't put space on either side of equal sign. Another point is, you can assign any values to a varible. No need of declearaing the variable type. See the examples. You will understand what I mean.

$ INT=123
$echo $123
$ 123
$ STRING=Anil
$ echo $STRING 
$ Anil

But if you needed, you can declare variable types or limit value assignment to varaibles using the bash builtin command "declare".

(more…)

Do you ever wonder what is happening when you login to a BASH shell. Why "ll" command works only on your office machine?? This article will give you a breif outlook on bash startup files. When you login the first file that is checked in your home directory is "~.bash_profile".
~ means your home directory.  This file will decide what all files have to be read during startup or the pragrams/commands to run when you login to bash.  A sample ".bash_profile"

(more…)

Bash tips - a small update to debugging bash scripts

Written by anil on Tuesday, June 26th, 2007 in Bash Scripting, Linux.

Here is a small update to, Bash tips - Debugging bash scripts We can also use other set parameters. set -f (Disable file name generation using metacharacters)

#set -f
#ls * /bin/ls: *: No such file or directory

Understand what happened? No more expansions.Wildcard is turned of. if "-f" is set bash will look for exact filenames. "*" is also considered as filename.

To turn it off use "+f"

#set +f

set -v (More verbrose) and"set +v"to turn off.

root@server4 [~]# ls tecpages .bash_profile —> Note this line
/bin/ls: tecpages: No such file or directory
.bash_profile

You can use set -xv when debugging to get a more verbrose output. Wondering what is "-x" for, please read Bash tips - Debugging bash scripts Thanks



Site Navigation