News:

SMF - Just Installed!

Main Menu
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - saurabhj

#16
How To's / How to write Shell Script ?
July 17, 2015, 06:28:18 PM
Following steps are required to write shell script:

(1) Use any editor like vi or mcedit to write shell script.

(2) After writing shell script set execute permission for your script as follows
Quotesyntax:
chmod permission your-script-name

QuoteExamples:
$ chmod +x your-script-name
$ chmod 755 your-script-name
Note: This will set read write execute(7) permission for owner, for group and other permission is read and execute only(5).

(3) Execute your script as
QuoteSyntax:
$ bash your-script-name
$ sh your-script-name
$ ./your-script-name

QuoteExamples:
$ bash bar
$ sh bar
$ ./bar

Note: In the last syntax ./ means current directory, But only . (dot) means execute given command file in current shell without starting the new copy of shell, The syntax for . (dot) command is as follows

QuoteSyntax:
. command-name

QuoteExample:
$ . foo


Now you are ready to write first shell script that will print "Milesweb Hosting Services" on screen. See the common vi command list , if you are new to vi.
Quote$ vi first
#
# My first shell script
#
clear
echo "Milesweb Hosting Services"

After saving the above script, you can run the script as follows:
Quote$ ./first

This will not run script since we have not set execute permission for our script first; to do this type command
Quote$ chmod 755 first
$ ./first

First screen will be clear, then following output will appear on screen.
QuoteOutput :
Milesweb Hosting Services
#17
Different types of shell

A number of different shells have been developed for Unix-Like Operating System; the most popular are described here.

[1]  Bourne Shell(sh):-
        Original Shell of Unix.
        Written by Stephen Bourne at Bell Labs in 1974.
        Lacked interactivity provided by most modern shells.

[2]  C Shell(csh) :-
        provides a C-like language to write shell scripts

[3]  Korn Shell :-
        created by David korn
        Has features of C and Bourne shell along with some additional features.

[4]  TC shell (tcsh) :-
        Default shell of FreeBSD and its descendants.
        Available in the public domain.

[5]  Bourne-again shell (BASH) :-
        Default shell of Linux Operating System.
        Developed by GNU project
        It is based on Bourne shell and has features of Bourne and C shell as well

How to check Shell's available in your system ?
Quote   :   cat /etc/shells

To find your current shell type following command
Quote   :   echo $SHELL
#18
How To's / What is Shell Script ?
July 17, 2015, 05:31:09 PM
Normally Shells are interactive. It means shell accept command from you (via keyboard) and execute them. But if you use command one by one (sequence of 'n' number of commands) , then you can store this sequence of command to text file and tell the shell to execute this text file instead of entering the commands.

This is know as Shell script.

Shell script defined as:
"Shell Script is series of command written in plain text file. Shell script is just like batch file in MS-DOS but have more power than the MS-DOS batch file."
#19
Domain Names / Re: Name Servers
July 09, 2015, 06:24:33 PM
Yes.
It is true that you can have name servers of only one company for a domain name.