Awk is a powerful text analysis tool, with the search for grep and the editing of SED, which is especially powerful when it comes to analyzing data and generating reports. To put it simply, awk reads the file line-by-row, using spaces as the default
Shell Programming Four musketeers:Sed awk grep findSed can replace, delete, add, pick, and select data rows for specific tasks1.sed If you do not add any parameters, you will not be able to modify the contents of the file. The plus-i parameter is
Catalogue
1. List of special variables
2. Special Instructions
In the shell, variable names can only contain numbers, letters, and underscores, because some variables that contain other characters have special meanings, and such
1. Clear the contents of the fileCat/dev/null >>/var/log/messages2. The script to determine whether the user is the root userRoot_uid = 0 # $UID is 0 o'clock, the user has root user rightsIf ["$UID"-ne "$ROOT _uid"]Thenecho "This user isn't
Output System Information#!/bin/bashif [$#-eq 0];then echo "---------------------------------------------------------------------------" # OS type echo "OS Type: $ (uname-o)" # OS Release Version and Name echo " OS Release Version and Name: $
Before I made a sentence in the Forum Hack tool.Therefore, the decision is based on the change, in line with the use of some people.The previous version only supports https/aspx, this time after the improvement, it is also the last
Shell Features:History is saved in ~/.bash_hostory and retains 1000 records: defined inEcho $HISTSIZE!: Previous Command!$: Last parameter of previous command! 950: No. 950 order!c: The most recent command in history that starts with CTAB: Command
The format of logical judgmentscase. Sh#!/bin/Bashread-P"Please input a number:"nm=$[$n%2] Case$minch 1) echo"It is a Jishu '" ;; 0) echo"It is a oushu." ;; *) echo"Not is a Jishu and Oushu."EsacEnter a string of
Shell script implements Tomcat self-bootWhen a script is run on a machine, it can implement Tomcat self-boot,However, the script was added to the timed task, but the error was reported: Java.lang.UnsupportedClassVersionError.Cause of errorThis is
1#!/bin/Bash2 3send_thread_num= -#设置进程数. 4tmp_fifofile="/tmp/$$.fifo"# The current process ID number that the script runs as the file name5 Mkfifo "$tmp _fifofile"# Create a new random FIFO pipeline file6Exec6<>"$tmp _fifofile"# Definition File
Create a shell scriptmkdir ShellVim first.sh#!/bin//tmp/"my home is $HOME""This is first Script"Execute shell scripts, two methodsBash first.shMysql.sock Www_slow.log2015-12-31.wangshaojun.root.history-timestamp Pear
Functions: Naming rules are the same as variablesExecuting functions in the current shell processModularity of the program for easy maintenanceBasic function Syntax: function function name () { Command Area }
Transferred from: http://blog.chinaunix.net/uid-23046336-id-3475462.htmlPrograms programmed under Linux apes know shell scripts, and even if you're not familiar with them, you should have heard them! What about the dead loop in the shell script?For
Log-in Shell:Login via terminalSu-usernameNon-logon Shell:Su USERNAME (switch user with Su, without parameters)Open Command Window under GUIShell scripts executed automatically (using at, crontab, Anacron, etc.)Bash configuration file:Global
The use of SEQ in the shellExample:/bugzilla/group.00....group.99 more than 3 years of data mv to/history/bugzilla/group.00...group.99Seq-w (-w = 0 in front to make the same width)#!/bin/bashFor Inum in ' seq-w 00 99 'DoSsdir=/bugzilla/group.
The Linux shell is much more powerful in programming than Windows batch processing, both in loops and operations. Data types are not comparable. Here's a summary of some of the things that an individual does when it comes to working with arrays.1.
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