Create a text menu create a menu layout
root@wl-ms-7673:/home/wl/Desktop/shell# cat-n test1.sh
1 #!/bin/bash
2 echo-e "\t\tmenu"
3 ECHO-E "1.\tdisplay disk Space"
4 echo-e "2.\tdisplay logged on user"
"Note 1": unlike Java, PHP and other languages, SH's process control can not be empty, such as:
The code is as follows:
You can't write this in Sh/bash, if the Else branch has no statement execution, don't write this else, like this:
If
Original works, allow reprint, reprint, please be sure to hyperlink form to indicate the original source of the article, author information and this statement. Otherwise, legal liability will be held.
[Root@node1 ~]# Spark-shell--master yarn-client warning:master yarn-client is deprecated since 2.0.
Please use the master "yarn" with specified deploy mode instead.
The Using Spark ' s default log4j profile:org/apache/spark/log4j-defaults.properties
The meaning of shell variable $#,$@,$0,$1,$2 in Linux is explained:
Variable Description:
$$
The shell itself PID (ProcessID)
$!
The PID of the Shell's last running background process
$?
End code of the last command to run (return value)
$-
Flag
The error is as follows -/ ./ . the: -: toERROR cluster. Yarnclientschedulerbackend:yarn application have already exited with state finished! -/ ./ . the: -: toERROR client. transportclient:failed to send RPC8494797597505892687To/192.168.1.21:44578
Theoretical part:1, in a simple script, each of the statements executed sequentially, so as to achieve automated management,Sequential single execution is too mechanized, not "smart" enough to achieve more flexible system tasks.Example: Bulk Install
Learn the first script from the shell, thanks to cloud Li Qiangqiang Teacher's shell programming tutorial
To create a shell script file:Touch menu.shTouch index.shTouch welcome.sh
To give the script file permission to execute:chmod a+x
Laboratory has a server in the room, installed is the Ubuntu Server,ip for automatic allocation, so once the IP changes can not be remote operation, must go to the computer room to record the new IP. Learned a few days after the shell think, is it
The IF statement determines which branch to execute by using relational operators to determine whether an expression is true or false. The Shell has three kinds of if ... else statements:
If ... fi statement;
If ... else ... fi
Linux Run LevelLinux starts running at one level, and these run levels are listed below:0 System Stop1 Single user system, no login required2 Multi-user system but NFS not supported, command-line mode login3 full multi-user mode, command-line mode
My test is basically in the Mac, and the UNIX environment test, if no special note, the default is MacWhether you see this essay as an odd trick by the shell array, or find that the shell array can do so much work in a pair of {}, it is not clear
Fly2015Here the shelling procedure is my love crack training of the job 2, compared to the job 1 A little stronger, but as long as the control of the shelling of the ESP Law, take off this Nspack Shell is not difficult, but it is quite interesting.
Part 1: hadoop BinThe following hadoop bin is based on the actual needs of the project:Hadoop ShellHadoop-config.sh, which is used to assign values to some variablesHadoop_home (hadoop installation directory ).Hadoop_conf_dir (hadoop configuration
In a Windows environment, even though there are differences between Visual C ++, Delphi, and other software development tools, there is one thing that is the same: these are all running in windows. In the process of program development, you often
From the programmer's perspective, shell itself is a program written in C language. From the user's perspective, shell is a bridge between the user and the Linux operating system. You can enter commands for execution and use shell script programming
Function Description: Recalculate the parameter content.
Grammar: Eval [parameter]
Additional instructions: Eval can read a series of parameters and then execute them according to the characteristics of the parameters.
Parameter: Parameters are not
Linux Shell wildcards, escape characters, metacharacters, special characters, shell escape1. linux shell wildcard (wildcard)
Wildcards are processed by shell (not by the command statements involved, but we have not found any introduction to these
Single quotation marks, double quotation marks, and reverse quotation marks in shellIn shell, there are three types of quotation marks: single quotation marks, double quotation marks, and reverse quotation marks. Single quotation marks 'all
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