first, the application of shell variables1. Types of Shell variables·User-defined variables: defined, modified, and used by the user ·Pre-defined variables: Bash predefined special variables that cannot be modified directly·Positional variables:
Knowledge point 1, modify the color of the outputEcho-e "\e[1;31m This is red text \e[0m"Where \e[1;31m indicates that the output is displayed in red, the \E[0M logo resets the color, and 31 can be replaced by a different color value, which is used
Day01Write a script to do the following: Enter a number, and then run the corresponding command. The display command is as follows: *cmd meau** 1---date 2--ls 3--who 4--pwdWhen you enter 1 o'clock, you run the date, enter 2 o'clock to run LS, and so
It's annoying to unload the system following the OPENJDK and then install the orcle jdk every time, soWriting a script execution is a hassle, just put the following bash script and the one you're downloadingThe jdk-7u79-linux-x64.tar.gz package can
1. Condition Judgment:If use:if condition; Then commands; fiIf else uses:if condition; Then commands; Else if Then commands; Else commands; fiDescription&&| | action; # If condition is false, the action is executed. && is the logic and operator, |
Call makefile in Ant and use the make command in the shellXML version= "1.0" encoding= "Utf-8"?> Projectname= "Dy_cike_init"Basedir="."> Targetname= "HAIT_CPR"Description=""> execexecutable= "/bin/sh"> Arg Line= "-C
Toggle command line: CTRL+ALT+F1-F6
Switch to graphical interface: CTRL+ALT+F7
Ls-list (dir under Win)White: Normal fileBlue: Catalog FileGreen: Executable fileTo perform the steps:
Input ls
In the relevant directory go to the
& placed after the startup parameter to set this process as a background process
By default, the process is the foreground process, then the shell is occupied, we can not do other operations, for those who do not interact with the process, many
Classification of regular expressions
Basic Regular Expressions (basic Regular expression also known as basic RegEx abbreviation Bres)
Extended Regular expression (Extended Regular expression also known as Extended RegEx abbreviation
Types of variables:1. Custom variablesDefine variables: Variable name = variable value variable name must start with a letter or underscore, case sensitive url1=test.3glong.comReference variable: $ variable name or ${variable name}View variables:
View current ShellEcho $SHELLgrep root/etc/passwdBeginning:#!/bin/bash#!/bin/shls-l/bin/shShell typesCat/etc/shells/etc/init.d/nfs/etc/init.d/crond/etc/init.d/rc.d/rc.sysinitBash--versionThe shell performs three ways:1,sh T.s or Shell
First shell script--helloworld[Email protected] ~]# VI sh01.sh#!/bin/bash #! Indicates which shell# this is my first shell script #注释部分echo-E "Hello world!" Exit 0[[email protected]~]# SH sh01.sh # execute SH file Hello world! using bash or SH
[] is actually shorthand for the test command in bash. That is, all [expr] equals test exprFor the test command, use-eq to make a numeric comparison, and when you pass in the string, you get an error.[[expr]] is a real conditional judgment statement
The purpose of this program is to execute shell scripts on the remote machine."Environment Parameters"Remote machine ip:192.168.234.123User name: RootPassword: rootPath to shell script:/home/ifilegentool/bakprovisionandoccurentrance.sh"Concrete
1. SortA. Sorting strings by default B. With-r option: Reverse sort C. Specify the option data field separator with-T, and the-K option specifies the data field to compare D. Use the-N option to specify "pure digit sorting". As can be seen in the
Suddenly want to find a place to write a little article, and think of this old account, not because of the long-term silence was deleted is very touched ... All right, let's just commemorate this. First day.I suddenly wanna write something and
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