Search

Bash
Bash script to search for working machines in a network PDF Print E-mail
User Rating: / 1
PoorBest 
Programming - Bash
Tuesday, 29 June 2010 16:15

Below I give a small script that will help you to discover the machines that are plugged on to the network. It uses a small command called ping to discover the machines connected to the network. It will work only for the networks with subnet mask 255.255.255.0

 

 #!/bin/bash

> validip

> invalidip

echo "enter the first ip address"

read i

echo "enter the last ip address of the same subnet of mask 24 bit"

read j

 

Last Updated on Sunday, 04 July 2010 17:59
 
Bash commands PDF Print E-mail
Programming - Bash
Monday, 29 June 2009 20:19

try entering the command

 

info coreutils

 

in the terminal and you will get commonly used bash commands as shown.

 

Last Updated on Wednesday, 08 July 2009 06:57
 
How to start bash scripting? PDF Print E-mail
Programming - Bash
Tuesday, 07 July 2009 07:11

To begin with bash scripting, let me introduce you to bash scripting. Bash script file is a file which consists of a sequence of bash commands to be executed starting with an interpreter. It helps you to reduce the time by avoiding repetitive use of commands in the terminal. Instead you can type that sequence of commands in order to a scripting file and save.

 Procedure

Open a new file. We must first specify the shell we are using. It should preceed with a #! called 'shebang'. It provides the path to to the interpreter.Usually we use '/bin/sh' for using the default shell. '/bin/sh is a pointer to our default shell'. Or we can specify the shell as '/bin/bash'. Then we start writing the series of commands to be executed. Any line preceeding with a '#' is considered as a comment. An example of a shell scripting file is given below.

 

Last Updated on Wednesday, 08 July 2009 07:08
 


We have 90 guests online