Xshell 7 (Build 0108)
Copyright (c) 2020 NetSarang Computer, Inc. All rights reserved.
Type `help' to learn how to use Xshell prompt.
[C:\~]$
Connecting to
Connection established.
To escape to local shell, press 'Ctrl+Alt+]'.
WARNING! The remote SSH server rejected X11 forwarding request.
Activate the web console with: systemctl enable --now cockpit.socket
Last failed login: Fri Jul 1 15:00:38 CST 2022 from on ssh:notty
There were 562 failed login attempts since the last successful login.
Last login: Sun Mar 20 20:46:44 2022 from 120.235.92.59
[root@VM-16-2-centos ~]# vim test.sh
[root@VM-16-2-centos ~]# chmod +x ./test.sh
[root@VM-16-2-centos ~]# ./test.sh
Hello keyi!
[root@VM-16-2-centos ~]#
写了第一个shell脚本,之前对shell的概念模糊不清:Shell 是一个用 C 语言编写的程序,它是用户使用 Linux 的桥梁。Shell 既是一种命令语言,又是一种程序设计语言。Shell 是指一种应用程序,这个应用程序提供了一个界面,用户通过这个界面访问操作系统内核的服务。
Shell 脚本(shell script),是一种为 shell 编写的脚本程序。
业界所说的 shell 通常都是指 shell 脚本,但读者朋友要知道,shell 和 shell script 是两个不同的概念。