Tuesday, November 24, 2009
Posted by venu k
7 comments | 2:20 PM
Hello friends, I have watched this video on Youtube.I hope you will also enjoy it.Original link for this video is http://www.youtube.com/watch?v=bYcF_xX2...
Tuesday, November 17, 2009
Posted by venu k
9 comments | 11:58 AM
#!/bin/bash# SCRIPT: primenumbers.sh# USAGE : ./primenumbers.sh <Range Value># or;# ./ primenumbers.sh <Start Range Value> <End Range Value># PURPOSE: Produce prime numbers within a range lmit.############### DEFINE FUNCTIONS HERE ##############Usage(){ echo "********BAD ARGUMENTS**********" echo "Usage: scriptname <Range Value >" echo " or " echo "Usage: scriptname <Start Range Value> <End Range Value>" exit 1}################# ARGUMENTS...
Posted by venu k
21 comments | 8:46 AM
Reposted on 18-06-2011 and Method 4 was deleted.The simplest primality test is as follows: Given an input number n,check whether any integer m from 2 to n − 1 divides n. If n is divisi-ble by any m then n is composite, otherwise it is prime.Method 1:Now most people who write finding prime number in shell script(Almostin all languages) may start with something simple, like:#!/bin/bash# SCRIPT: prime1.sh# USAGE : ./prime1.sh# PURPOSE: Finds whether given number is prime or not#####################################################################echo...
Sunday, November 15, 2009
Posted by venu k
126 comments | 1:19 AM
Like UNIX commands, shell scripts also accept arguments from the command line.They can, therefore, run non interactively and be used with redirection andpipelines.Positional Parameters:Arguments are passed from the command line into a shell program using thepositional parameters $1 through to $9. Each parameter corresponds to theposition of the argument on the command line.The first argument is read by the shell into the parameter $1, The secondargument into $2, and so on. After $9, the arguments must be enclosed inbrackets, for example, ${10},...
Thursday, November 12, 2009
Posted by venu k
5 comments | 1:17 AM
Method 1:#!/bin/bash## SCRIPT : leapyear.sh# PURPOSE: Checks whether given year is a leap year or not# USAGE : sh leapyear.sh # If Year value not supplied, it takes current year as default## This script based on, One year has the length of 365 days, 5 hours,# 48 minutes and 47 seconds. Because this is rather non-functional,# a normal year has been given 365 days and a leap year 366 days.#################################################################### DEFINE FUNCTIONS HERE #########################################################################Leap(){#...
Monday, November 2, 2009
Posted by venu k
2 comments | 4:21 AM

This script not replaces cp command. This is a sample script for practice purpose.I am going to develop more elegant script, which fulfil most of the cp command strengths.I will post complete version of the script as soon as possible,I shall really appreciate all comments and suggestions to improve this script.#!/bin/bash## SCRIPT: ddcopy_progress.sh# PURPOSE: This script is used to watch progress of copying.## Note: I am using destination file...
Sunday, November 1, 2009
Posted by venu k
7 comments | 11:56 AM
#!/bin/bash## SCRIPT: bigfile.sh# PURPOSE: This script is used to create a text file that# has a specified number of lines that is specified# on the command line.#usage(){echo "............USAGE ERROR............"echo "USAGE: $0 <number_of_lines_to_create>"}# Argument Checkingif [ $# -ne 1 ] # Looking for exactly one parameterthen usage # Usage error was made exit 1 # Exit on a usage errorfi# Define files and variables hereLINE_LENGTH=80 # Number of...
Subscribe to:
Posts (Atom)