Shell Programming Four Musketeers practice--awk

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 practice--sed

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

Shell Special variable collation of "Linux"

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

Commonly used action statements in shell script files

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

Shell programming-instance output system Information

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: $

Comprehensive sentence shell hack

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

Linux Shell Learning

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

Shell---Login failed IP add to/etc/hosts.deny

/etc/hosts.deny: Commonly known as blacklist, control remote access settings.#!/bin/bash           //program starts #file: hosts_deny.sh# date: 2016-01-10grep  ' Failed password '  /var/log/secure | awk  ' {print $ One} '

Shell Programming Advanced 1.7 Case Selection

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 Environment variables

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

Comparison in bash shell

1. Arithmetic comparison Operator Describe -eq Equals -ne Not equal to -gt Greater than -lt Less than -ge Greater than or equal

Shell concurrent multi-process simultaneous execution

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

Shell programming advanced 1.2 shell structure and execution

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

[Note]shell Basics of function usage

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          }    

Application of eval in shell

Application of eval in shellEval can be used for nesting of variablesDr=ddir$inumEval ssdir=$ (Echo \$ $SR)Example:#!/bin/bashDate= ' Date +%y%m%d

"Simplest dead loop" "Turn" of shell script programming

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

[Note] Login Shell vs. non-logon shell

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 shell

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.

Shell's Tomcat log backup

#!/bin/bashbackdir=/backup/logs/' Date +%f ' catdir=/home/tomcat/apache-tomcat/logsbackfile= ' find $CATDIR-type F- Mtime +3|grep-v catalina.out ' ceshi= ' echo $BACKFILE |wc-l ' Logfile=/home/lichuang/backup.logbackup () {if [$CESHI-le 1]t hen echo

Linux shell array creation and usage tips

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.

Total Pages: 541 1 .... 365 366 367 368 369 .... 541 Go to: GO

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.