Introduction to Shell 1

Source: Internet
Author: User

All Unix users should understand how to use the Korn shell script. By writing shell scripts, You can automate many tasks and save a lot of time. It seems daunting at first glance, but you can use it skillfully as long as you follow the correct guidance. This document describes how to write your own Korn shell script.

What isShell?

Like other UNIX-like operating systems, the ibm aix operating system must communicate with the kernel in some way. This task is implemented by using shell. You can use different shells, but this article focuses on Korn shell. The Korn shell is the default shell used by Aix.

When you log on to Aix, the system starts with a directory prompt. The default directory is usually your home directory. This is called the Home Directory because the structure of this directory is usually as follows:

$/Home/jthomas:

 

When you log on, you will be in the command line or command prompt. This is exactly where you enter the Unix Command. You can enter shell commands that interact with the Unix kernel. These commands may be as simple as only one line (such as viewing the date) or multiple lines, depending on your operations.Listing 1Provides some sample commands.


List1.Example command

$ Date

Fri might 1 22:59:28 EDT 2008

$ Uptime

PM up 259 days, 5 Users, load average: 3.81, 14.27, 13.71

$ Hostname

Gonzo

 

One of the best features about shell commands is that you can combine multiple commands in a file called a script, which allows you to run multiple commands in sequence. When you have to run the same command again and again, it is appropriate to use the script. You can put these commands in a Korn shell script without repeatedly typing them.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.