1, shell script generally to #! Beginning.2, printf:printf "%-5s%-10s%-4s\n" No Name Mark. %-5s indicates a string substitution with a left-aligned format of 5 (-left-aligned) and, if not used-to specify alignment, the string is aligned to the right.
The shell script's reference book from the foundation to the advanced can find hundreds of, the beans here for the entire study note integrity, or audacity the most basic grammar review again. The most basic include variables, comparisons, operators,
Reprint: http://www.cnblogs.com/lr-ting/archive/2013/02/28/2936792.htmlecho Display in shell script with color display, echo display with color, need to use parameter-EThe format is as follows:For example:Where 41 of the position represents the
Learn from this section the main control statements, loop statementsComments, Shell Multiline commentsThe Shell line comment is simple, just add # at the beginning of each line, but he does not provide a special multi-line comment method, so we use
This time change the structure of the notes directly. Lit LEDs are always an introductory routine for learning MCU,ARM,FPGA, which can be said to be a classic routine. The author also started the Arm learning journey from the point of light led.The
The format of the while loop: while expression Do Commandcommand 、、、 Done1. Counter-controlled while loop:Used primarily for the number of data and strings that have been accurately known to be entered.Example:#!/bin/bashint=1 while (($Int. 5 ))
Record a shell script case that includes some syntax for the shell (function definition, expression operation, if, case ...). )#!/bin/sh#获取当前时间run_time= ' Date +%h%m%s '#取当前日期前一天Get_ydate (){#设置当前年月日today= ' Date +%y%m%d 'Month= ' Date +%m 'day= '
In the bash Shell , $ () and "(anti-quote) are used for command substitution.The so-called command substitution is similar to the variable substitution we learned in the fifth chapter, which is used to reorganize the command line:* Complete the
For example, comparing strings, judging whether the file exists and whether it is readable, etc., usually uses "[]" to represent the condition test.Note: The space here is important. The space to ensure the square brackets. I have wasted a lot of
Shell processing strings and {} operations1. Get the length of a variableThere are about 4 ways to get the length of a string: (in the case of Hello World)
Passwc -L $ echo "hello world" | wc -L 11
Passexpr length string$ expr length
& placed after the startup parameter to set this process as a background processBy 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 times,
Linux Shell Script Raiders notesChapter II: Common Commands1. Cat cat-s//Multiple blank lines compressed into one cat *.txt | Tr-s ' \ n '//Remove blank line Cat-n//Gach No. 2, find goes down the file hierarchy, matches the qualifying file, and
Hbase Shell DetailsHBase provides users with a very convenient way to use it, which we call "HBase Shell." The HBase shell provides most hbase commands, which can be easily created, deleted, and modified by HBase shell users, as well as adding data
Linux Shell Script Raiders notesFourth Chapter: Efficient Text Processing1, the IP address of the regular expression: [0-9]{1,3}\. [0-9] {1,3}\. [0-9] {1,3}\. [0-9] {1,3}2, grep usage//recursive retrieval of text in a multilevel directory [[email
The 1.bash shell is the default shell command interpreter for most Linux distributions, but a recent burst of bash shell has been exploited.2. If bash is the default system shell, network attackers can attack servers and other Unix and Linux devices
Shell implementation Associative array
Shell implementation Associative arrayWrite the input and output of the array with the shell; there is a file, the first list of host names, the second column IP address, how to enter the hostname return IP
Password Change in non-interactive mode in Shell scriptsToday, when I wrote a shell script, I found that the user's password needs to be set and the password is set to interactive. This is obviously not good in the script, So I went online to search
Java beauty [from cainiao to expert drills] using shell scripts in Linux (1), javashellAuthor: erqing
Personal site: zhangerqing.cn mail: xtfggef@gmail.com Weibo: http://weibo.com/xtfggef
Shell scripts combine multiple commands and write them
Shell Programming Application-automated website backupRsync is a data image backup tool in unix-like systems-remote sync. A Fast Incremental Backup Tool, Remote Sync, supports local replication or synchronization with other SSH and rsync hosts.
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.