• Android

    Android is an operating system based on the Linux kernel, and designed primarily for touch screen mobile devices such as smart phones and tablet computers. Android is a Linux-based software system, and similar to Linux, is free and open source software. This means that other companies can use the Android operating developed by Google and use it in their mobile devices.Android gives you a world-class platform for creating apps and games for Android users everywhere, as well as an open marketplace for distributing to them instantly.

  • Welcome to Bashguru

    Linux is one of popular version of UNIX operating System. It is open source as its source code is freely available. It is free to use. Linux was designed considering UNIX compatibility. It's functionality list is quite similar to that of UNIX and become very popular over the last several years. Our Basic motive is to provide latest information about Linux Operating system.

  • Python Programming

    Python is a comparatively simple programming language, compared to c++. Although some of the benefits of c++ are abstracted away in python, they are replaced with an overall easier to learn language with many “intuitive” features. For this reason it is common and recommended by most professionals that people new to programming start with python.

  • Perl Programming

    Perl is an open-source, general-purpose interpreted programming language. Used often for CGI, Perl is also used for graphics programming, system administration, network programming, finance, bioinformatics, and other applications. The Perl languages borrow features from other programming languages including C, shell scripting (sh), AWK, and sed. They provide powerful text processing facilities without the arbitrary data-length limits of many contemporary UNIX command line tools, facilitating easy manipulation of text files.

  • Android

    Android is an operating system based on the Linux kernel, and designed primarily for touch screen mobile devices such as smart phones and tablet computers. Android is a Linux-based software system, and similar to Linux, is free and open source software. This means that other companies can use the Android operating developed by Google and use it in their mobile devices.Android gives you a world-class platform for creating apps and games for Android users everywhere, as well as an open marketplace for distributing to them instantly.

  • Welcome to Bashguru

    Linux is one of popular version of UNIX operating System. It is open source as its source code is freely available. It is free to use. Linux was designed considering UNIX compatibility. It's functionality list is quite similar to that of UNIX and become very popular over the last several years. Our Basic motive is to provide latest information about Linux Operating system.

Tuesday, September 22, 2009

Posted by venu k
1 comment | 10:22 PM
#!/bin/bash# sys_monitor2.sh# Usage: sys_monitor2.sh [-u|-d|-f (D/M)| -c number | -m number]# Sample system monitor script using options# Tested under Fedora 9Invalidoptions(){ echo "Usage: `basename $0` [OPTIONS]" echo "OPTIONS:" echo -e "\t -d for display today's date" echo -e "\t -u for Logged in users list" echo -e "\t -f ARG for Disk and Memory Statistics" echo -e "\t (ARG=D for disk statistics; ARG=M for memory statistics)" echo -e "\t -c ARG for Top CPU consuming process" echo -e "\t (ARG=10 means top 10...
Posted by venu k
12 comments | 9:31 PM
#!/bin/bash# sys_monitor.sh# Sample system monitor script using menu# Tested under Fedora 9## Create the following menu and clear the screen each time it appears#clearecho -e "\033[1m `uname -or` Monitor script\033[0m"items=" 1.Date 2.Current Users 3.Disk Statistics 4.Memory Statistics 5.Top 10 Memory consuming process 6.Top 10 CPU consuming process 7.Exit"exit_function(){ clear exit}#function enter is used to go back to menu and clear screenenter(){ ans= echo "" echo -e "Do you want to continue(y/n):\c"...

Saturday, September 19, 2009

Posted by venu k
78 comments | 10:33 AM
#!/bin/bash# isuserloggedin.sh# Usage: isuserloggedin.sh username# Shell script which checks after every one minute whether a user has logged in# or not# You can also run script in background using & then foreground it to view resultif [ $# -ne 1 ]then echo "You supplied wrong arguments" echo "usage : `basename $0` username"exit 1fiisuserexist(){grep -w "$1" /etc/passwd > /dev/nullif [ $? -eq 1 ]then echo "$1 is not a valid user"exit 1fi}isuserexist $1time=0while truedo# you can replace following two statements with# if `who|grep...
Posted by venu k
12 comments | 10:11 AM
#!/bin/bash# validuser.sh# Usage: validuser.sh username# Script to check whether suplied user has an account in your systemif [ $# -ne 1 ]then echo "You supplied wrong arguments" echo "Usage : `basename $0` user_name"exit 1fi#grep -w "$1" /etc/passwd > /dev/nullgrep -w "^$1" /etc/passwd > /dev/nullif [ $? -eq 1 ]then echo "$1 is not a valid user"else echo "$1 is a valid user"fi# Using greps -q option you can simplify and faster your script# if `grep -qw "^$1" /etc/passwd`# greps -q option prints nothing just returns exit status 0...

Wednesday, September 2, 2009

Posted by venu k
8 comments | 1:25 PM
There are various ways to read input within the time limit in shell script. I am posting 4 methods here.First three are direct methods. Final one implemented with some logic, just for practice only.Method 1: #!/bin/bash # timedinput1.sh: prompts times out at five seconds. # Using read command timelimit=5 echo -e " You have $timelimit seconds\n Enter your name quickly: \c" name="" read -t $timelimit name #read -t $timelimit name <&1 # for bash versions bellow 3.x if [ ! -z "$name" ] then ...