The test command is very powerful, but it is difficult to satisfy its escape requirements and the difference between string and arithmetic comparisons.
Greater than
Less than
Equals
Not equal to
If ["$a"-gt "$b"]
A shell program that replaces a section of a line near a keyword in a text file:
#!/bin/bash file=$1 findpattern=$2 linegap=$3 replacepattern=$4 substitue=$5 Help () {echo Help:echo \$1:file\ ' s full Path \ (include filename\) echo \$2:the key
For some Ubuntu geek, they sometimes prefer to use the command line to launch apps on the phone and debug our app in this way. We can enter into the shell of the phone in the following ways:
We can find the following pre-installed
在study(Shell)专栏中,会深刻学习到shell编程And as an OPS person, the most basic ability is to learn shell script programmingTo improve efficiency in our work!Shell Programming:Compiler: Also called interpreterThe shell provides us with another function: To
Use Shell to write a simple calculator, you can implement add, subtract, multiply, divide operation, if the script name is 1.sh, execute example:./1.sh 1 + 2#!/bin/bashif [ $# -ne 3 ]then echo "The number of parameters should be 3, for example: $0
Five Week fifth session (January 12)
8.10 Shell Special Symbol Cut command
8.11 Sort_wc_uniq Command
8.12 tee_tr_split Command
8.13 Shell Special Symbol
Related Quiz title: http://ask.apelearn.com/question/5437
Extended
Main introduction vim, Nano, emacs,kwrite,kate,gnome10.1 vimUnix System's original editor10.1.1 Check VIM PackageFigure out what kind of VIM package your Linux system is using.Under the Wu ban map:$which VI$readlink –f/usr/bin/viREADLINK–F * * * can
Many programs impose some logical control processes on the commands in shell scripts.Structured commands allow you to change the order in which programs are executed. It's not necessarily in sequence.12.1 using the If-then statementThe following
Functions in the shellThe function is to organize a piece of code into a small unit, and give the small unit a name, when the code is used to call the name of the small unit directly. Format: function F_name () {Command}The function has to be on the
The RC in the configuration file. bashrc in the home directory indicates resource configuration.
What is login shell? What is a non-Logon shell?
Logon shell refers to the shell that is started after the user enters the user name and password
Shell syntax error: unexpected end of file error message
if [ -n "$1" ]then echo "111"else echo "222"fiexit 0
Execute sh my. Sh par and prompt syntax error: unexpected end of file. Why?
Text editing is a file written in notepad in windows and runs
In shell, there are three types of quotation marks: single quotation marks, double quotation marks, and reverse quotation marks.
Single quotation marks 'all characters enclosed by single quotation marks are common characters. When special characters
1. shell script execution Method
There are two ways to execute shell scripts. One is to generate a new shell and then execute the corresponding shell scripts. The other is to execute the shell in the current shell and no longer enable other
In Linux, you can specify an alias for an alias command: in Linux, if the command is too long and does not conform to the user's habits, you can specify an alias for it. Although you can create a "Link" for a command to solve the problem of long
Google's Chrome OS shortdes a shell environment known as chrome shell, or "crosh" for short. crosh events des several terminal commands that can be used on all chromebooks, even ifdeveloper mode isn't enabled.
Crosh includes commands for connecting
Sudo addgroup hadoop # Add a hadoop GroupSudo usermod-a-g hadoop Larry # Add the current user to the hadoop GroupSudo gedit ETC/sudoers # Add the hadoop group to sudoerHadoop all = (all) All after root all = (all) All
Modify hadoop Directory
This article is the second chapter of "learning the bash shell" 3rd edition, command-line editing, Reading Notes. But we will not limit this.
In general, I just try to press it directly. If an error occurs, use the cursor and arrow on the left or
For example, to compare strings, determine whether a file exists, and whether the file is readable, "[]" is usually used to represent a conditional test.
Note: spaces are important. Make sure that the square brackets have spaces. I used to waste a
Differences between console, terminal, tty, shell, and other concepts
Linux has been used for some time, but I still cannot understand the differences between these concepts. Although I have been using it all the time, many concepts are vague, so it
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.