Shell Entry Notes (i)

Source: Internet
Author: User
Tags save file

Shell Introduction

During the development process, the Linux system is frequently contacted and used, and the shell is a bridge for our users to use Linux, and is a program written in the C language. The shell is a command language, as well as a programming language. For most developers, mastering the basic use of the shell is a required course.

Run the first shell program

1. New Shell Execution file

[Email protected] test]# VI testshell.sh

2. Enter the following in the file:

#!/bin/bash #约定
echo "Hello world!" #输出语句

3. Save file exit, modify Execute permission

[Email protected] test]# chmod +x./testshell.sh #允许脚本执行权限

[email protected] test]#/testshell.sh #执行脚本

Hello Word!

Note: It is written ./test.sh, not Testshell. SH , because the current directory is not the system path path, only/bin,/sbin,/usr/bin,/usr/sbin, etc. in path.

4, another mode of operation, run the Interpreter

/bin/sh testshell. SH

Hello Word!

Shell Entry Notes (i)

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.