Shell Programming-environment variable configuration file

1.source commandAfter you modify the configuration file, you must log off and re-login to take effect, using the source command can not re-loginSource Configuration file. Configuration fileThe environment variable configuration file is primarily

Linux Shell functions

IntroductionBody$?$? is a shell variable that represents the exit state of the last execution command. 0 for success, not 0 for failure. Remember: $? Always indicates the exit state of the shell command after the last execution, and when the

Shell script Programming wildcard characters

* matches any character of any length? Match any single character[0-9] Match all numbers[] matches any single character within the specified range[^] matches any single character outside the specified range[WXC] matches any one of the characters in

Shell script Batch Add user

Yes, this is a simple script, do not write do not know, write to find out how many shortcomings.The following script is mainly used to bulk add the user's script, originally very simple script, but added some judgment, to verify their own learning.1.

Shell Scripting App

Parse the scrambled log file into the temp file, then use the AWK1004CD/USR/LOCAL1005LL1006CD  pttmsg/ 1007  ll 1008  cd msgbin-2/ 1009  ll 1010   cd proxy 1011  ll 1012  cd log 1013  ll  1014  tail -1000 proxy_sub0_20160107.log  1015  grep  ' = = =

Shell IFS Example

IFS is the split symbol, the AA BB cc DD separately is $ $ $ $, when i=3, assigned to B DD. [[email protected] test]# cat 1#!/bin/basha= "AA:BB:CC:DD" ifs= ":" I=0for B in $A;d o [$i-eq 3] &                & b= $B; Let i++;d One;echo $b; [[Email

Shell Script--sed Tool

SedSED: it is called a streaming editor, and its working scenario is typically in the editor, where a piece of text is read in the SED in a row and then output in the specified way, which is its most basic usage.First, the basic operation of

Talk about export and Source,bash in shell scripts.

Little brother just contact Linux, a lot of things on Linux is more unfamiliar, so write a blog, as their work summary and technology accumulation bar, but also spur their efforts to learn.The reason for today's title is to put Export,source, Bash's

Shell Scripting Exercises

First, using the shell script to implement the progress bar#!/bin/bashfunction proc ()   4 {  5     count=0   6     bar= ""   7     lable= ("|"   "/"   "-"   "\")   8     while [  $count  -le  100 ]  9     do 10              let index=count%4 11     

Shell scripts: Exercises

Topic 1:1-100 summationNon-recursive version:#!/bin/bashsum=0while [$val-le]dolet sum+=vallet val++doneecho $sumsum =0for i in {1..100}doif [$i = = 1]; Thenbar=${bar}${i}elsebar=${bar}+${i}filet Sum+=idoneecho $bar = $sumsum =0for ((i=1; iOperation

"Shell" for loop

#!/bin/bashfor i in 1,3,4,6 # #有几个数就循环几次 does echo $i donefor m in $ (cat/root/num.log) # #/root/num.log a few lines Just loop a few times do echo-e "$m \ n" # #echo-E to recognize "\ n" done  Read-

[Shell Foundation]--read Command

Read command: Primarily used in the shell to read input, variables, text1. accept input from the standard input (keyboard) and assign the input data to the SET variable"Press Enter--indicates that the input is complete""If more data is entered than

Shell script: A simple score recording system

Directly on the code:#mcore. Sh#!bin/bashfunction colour () {case $1 inblack_white)  echo -e  "\033[40;37m ";; Black_green) echo -e  "\033[40;32m";; Black_cyan) echo -e  "\033[40;36m";; Red_yellow) echo -e  "\033[41;33m";; Yellow_blue) echo -e  "\033

"Shell" conditional judgment

expression format for conditional judgments:File Judging type:[[Email protected] ~]# [-E/ROOT/1] && echo yes | | echo no #注意 [] inside the space, the first command is true print Yes, otherwise print noyes[[email protected] ~]# [-F/ROOT/1] && echo

Shell Script Application Applet

The summation of 1...100Non-recursive:   #!/bin/bash read num count=1 sum=0 val= ""  ret= ""  while  [  $count  -le  $num  ] do    if [  $count  -eq   $num  ];then        val= $count     else         val=${count} ' + '     fi   

Shell Programming Arry Arrays

1. Copying and fetching valuesAssign Value #!/bin/basharry_name= (xiaoming xiaoli dalong Sanlang) echo ${arry_name[0]}echo ${arry_name[1]}echo ${arry_name[2] }echo ${arry_name[3]}[[email protected] ~]# bash Arry.shxiaomingxiaolidalongsanlang[[email

Definition and use of Shell arrays

Defining arraysIn the shell, the array is represented by parentheses, and the elements of the array are separated by a "space" symbol. The general form of the definition array is:Array_name= (value1 ... valuen)For example:Array_name= (value0 value1

Two tips for Linux shell: Shell arrays and string judgments

Recently, when using shell to write scripts, I want to implement two very simple functions in Python: 1: Determine if a string contains another string. 2: How to implement the list of Python work: 1. Here to share with you.1: Determine if a string

11.Shell arrays

The shell is much more programmatic in terms of programming than Windows batch processing, both in loops and operations.Bash supports one-dimensional arrays (which do not support multidimensional arrays) and does not limit the size of arrays.

Introduction to Windows Remote Shell (WinRM) usage

Recently, in order to experiment with the installation of Windows Server Core server, the system without a graphical interface always gives a very complete feeling, we have the idea of security in the end, using the Windows Remote Shell management

Total Pages: 541 1 .... 469 470 471 472 473 .... 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.