The use of conditional expressions in shell programming
If conditionThenCommandElseCommandFi, don't forget this ending.
If statement forgets the end fiTest.sh:line 14:syntax error:unexpected End of fi
Three
${#string}Returns the length of the $string
${string:position}In $string, start extracting substrings from the $position position
${string:position:length}In $string, the $length-length substring is extracted from the $position
1th Shell Basics 1.1 What is a shell
The shell is a command interpreter, which at the outermost of the operating system, is responsible for directly talking to the user, explaining the user's input to the operating system, and processing the output
Installing expect[[email protected] ~]# yum install -y expectUse a script to log into a remote machineScripting 1.expectThe contents are as follows:[[email protected] expect]# vim 1.expect#!/usr/bin/expectset host "192.168.130.128" #定义变量set
1, terminal (termimal) = TTY (teletypewriter, fax printer), the role is to provide a command of the input and output environment, under Linux using a combination of keys ctrl+alt+t Open is the terminal, you can think terminal and TTY is synonymous;2,
The shell is a bridge between the user and the Unix/linux operating system. The user can either enter command execution or use shell scripting to do more complicated operations. In the increasingly perfect GUI today, in the system management and
One, install secure shell, then the SSH Secure Shell client and SSH secure File Transfer client two shortcuts will appear.You need the server's IP address, username and password to connect to the server.Second, use SSH Secure file Transfer client to
There are some files and folders under the current folder, and there are several. txt files in each folder.Now requires a new folder to be created in the current folder all, and those folders all. txt filesare copied to the folder all. The shell
This article focuses on the parts of the bash script that are prone to errors and rarely used but have unexpected effects.Cycle:Normal for loop: for inch a B C 1 2 3 do Echo " $i " DoneNumber sequence loop: for in 'seq-do- echo'$i'done The '
Special characters in the shellIn addition to using ordinary characters in the shell, you can use special characters that have special meanings and functions. They should be used with special meaning and scope of action. Each of these special
Joined the caravan for some time, see the group inside the big head to check the blog, only to realize that I have not written homework. As the saying goes, the time is to kill the Pig knife!!! Cough, actually want to say, horse brother Video is
20.16/20.17 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????
A few days ago, a classmate in the group to raise an egg problem, the original question is as follows:There was a basket of eggs,One 1, just take it out.2, 2, take it, just finish it.3, 3, take it, just finish it.4 of 4, 2 left.5 of 5, 4 left.6, 6,
We have introduced the core implementation principles of mainstream double-layer encryption shells,And compatibility, while simplifying the encryption Shell Core with security considerations.The compatibility and security of the encryption Shell
Problem: Switching a user through the su command does not enter the user's shell environment. Why? To solve this problem, we must be clear about the difference between using Login Shell and non-login shell.
Login Shell:Complete logon process is
[Author] jivi (Qiao Wei)
[Tools] peid 0.94, ollydbg (ollyice), exists, 010 Editor
[J platform] WINXP
[Software name] Tang poetry three hundred first 1.2
[Software Overview] You can see the name.
Two days ago, I went to PPStream to see
1. System 2000
This section briefly describes how to launch DNS overflow attacks. I use dns.exe, and run it under CMD to view its usage parameters and other information. Run the "dns-s IP" command to check whether the target IP Address has a DNS
Reprinted from: http://blog.csdn.net/fox_lht/archive/2010/09/20/5897336.aspx7. Compound commands
Except for the simplest script, you rarely want to execute every command. Executing a group of commands or repeating a group of commands several times
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