MT FIRST BASH SHELL SCRIPT .. This script pings every ip address in a subnet and outputs the status of that ip whether that particular ip is assigned to a device or not. STEPS::::::: step 1------- open a new file(here i am using nano ) Now write the first line as : #!bin/bash This helps the shell to recognise the file as a script. Now you can add comments just by putting "#" symbol before your comment . step 2----- Write your script Here i am using For loop since, i have to ping multiple times here i also used exit status. Exit status tells whether the previous command was successfull or failled with any error. 0 means the command was succesfull and 1-255 any number in this range means an error(command failed to execute or unsuccessfull) In ping command 0 means there was a reply from ip address and 1 means no reply, rest may be for other network errors. Here to minimize time i used -c and -w options in ping command. -c is used to terminate...
Posts
Showing posts with the label script