Shell's for, while loop

One, for loop[email protected] shell]# cat for.sh#!/bin/bashFor i in ' seq 1 10 '; Doecho "$i"DoneWith this script you can see the basic structure of the For loop:The condition of the for variable name in the loop; do Commanddone[Email protected]

LNMP install shell script in one click

The previous period of time to maintain the server, need to install the LNMP environment, so I tidied up a bit, as a script, recorded.#!/bin/sh#copyright (c)  2010-2015 redapple  ([email protected]) #install  lnmp # version 0.1.1#date 20140813#------

Shell Font Color display

Format: "\033[display mode; front color; background color m string \033[0m"\033: Starting an escape sequence[: Start Color definitionThere are several ways to display the method:0 Terminal default settings1               高亮显示4               使用下划线5   

Shell script tracking and debugging

1. Shell Script debuggingUse the SH command to check the syntax of the shell and trace the execution steps. SH [-NVX] script.sh-n: Do not execute script, only check for syntax problem-V: Print script before execution-x: Print script to use2. Check

Shell Script Tracking

[Email protected] bin]$ sh-n restart.sh[Email protected] bin]$-N: Do not execute script, just check the syntax, if there is no output correctly, if there is an error, you will be prompted[Email protected] bin]$ sh-x restart.sh+

Shell cmd Set Note

1,exprA) expr Calculate//a=10;echo ' expr $a-1 'b) string index//a= ' ABCDE '; Echo ' expr index $a ' B ' | | String substr//a= ' ABCDE '; echo ' Expr substr $a 2 3 'c) regrexp//a=2,echoA) string Len//echo ${#a} | | String Index//echo ${a:1:4}CentOs

Shell scripts pass parameters with spaces

In another blog "Shell script implementation DB2 database table export to a file" implemented through the implementation of the script to export the DB2 database to a file, need to pass in seven parameters, the last is a string with a space, so when

Linux/centos shell script non-interactive password change

Today when writing a shell script to find the need to set the user's password, and the setting of the password is interactive, so in the script is obviously not very good, so the Internet to find information, found the following two non-interactive

Shell for Loop

Similar to other programming languages, the shell supports A for loop.The general format for A for loop is: for inch List Do command1 command2 ... CommandN DoneA list is a sequence of values (numbers, strings, and so on), each separated

The Linux Shell cannot be complete by pressing the TAB key

Today, I have a problem. The parameters behind git are tab-key, such as Git c_Search the internet for half a day to find the answer as followsToday in Linux with Useradd new users, found that the use of new users when landing, in the shell can not

Linux Common Commands (second Edition)--shell application tips

Tips:1, command completion function: key2, clear screen: ctrl+l3. Delete all contents before cursor: ctrl+u4. Command history: HistoricalThen:! The command label listed in history, you can execute that command. Such as:! 188Also: Press the arrow

Installing the Shell Editor on Linux

Divided into two partsFirst, install the B-shell interpreterInstall Cygwin eclipse to find the installed bin pathHttps://cygwin.comSecond, install the editor shelledDownload can get one: net.sourceforge.shelled-site-2.0.3help→ Install new software

Shell Quick Sort, redo text content

Visiting the Chinaunix forum, you can often see the Nikkei, how to quickly sort a text content, or calculate the number of occurrences of a line. Most of these problems can be solved by simple sort, uniq commands.Prepare two text firstCat File1:Boys

Getting started with shell programming (version 2) (I)

Simple example shell program Example 1. #!/bin/bash#This is to show what a shell script looks likeecho "Our first example"echo # This inserts an empty line in output.echo "We are currently in the following directory."/bin/pwdechoecho "This

The path to shell script self-learning-opening the door, a brief introduction and use

First, we will not introduce what shell scripts are. This blog only records every step of learning shell scripts. First, we will introduce the basic shell rules: The shell script is not a complex program. It is explained by line. The first line of

Chapter 2. Learning shell scripts Loop)

  While do done, until do done (indefinite loop)   While [condition]   Until [condition] Do program section done   [[email protected] scripts]# vi sh13.sh#!/bin/bash# Program:#Repeat question until user input

Shell Regular Expression string processing

A regular expression is a text mode consisting of common characters (such as characters A to Z) and special characters (such as metacharacters. This mode describes one or more strings to be matched when searching the text subject. A regular

Host warning processing after the esxi host opens the shell

Yesterday, in order to Configure SNMP monitoring, the shell of several esxi 5.5 hosts was changed from disable to enable on the console. After logging on to vcenter, all hosts were warned. The process is as follows: Select a host with a warning

View network configurations using shell scripts

View network configurations using shell scripts #!/bin/bashifconfig|grep -E 'eth|inet'|grep -Ev '(inet6|127.0.0.1)'|sed 's/ /\n/g'|awk NF|grep -Ev '(inet|encap|Link|HWaddr)'|sed 's/00:/MAC:/g';route|grep default|awk '{print "\nGATEWAY:"$2}'cat

What is the difference between shell Learning (and?

What is the difference between shell Learning (and?Strictly speaking, Because 0 is the default value of > This method is used to export data to a file. If the file does not exist, the file is created. If the file exists, the file is cleared.

Total Pages: 541 1 .... 202 203 204 205 206 .... 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.