Double horizontal bar and single horizontal bar in Shell parameters

A shell process is a process that executes other processes, but when a command is executed, the shell process instructs the kernel to execute the specified program separately as another process and write the output to the terminal. With the command

Array operations in the shell

1. Array definition, the shell uses a pair of parentheses to represent the array, and the array elements are separated by "spaces" # empty array arr1 arr1= () # array arr2, members are 1, 2, 3, 4, 5, 6 arr2= (1 2 3 4 5 6) 2. Array elements read,

Bash command and Shell script Summary (8) cyclic article __shell

@WHILE Loop Statement @ V1=1 While ["$v 1"-lt "6"] #注 [and] have spaces around them,-lt have spaces before and after them. Todo echo "This is the $v 1 ' showing up" v1=$ (($v 1+1)) #注意 $ (()) is a mathematical formula Done @FOR Loop Statement @ For

Shell recursive function---loop copy file to the specified directory

Function: Title Code: #!/bin/sh recursive () {for file in $ do subfile= ' ls $2$3/$file ' for SUBSUBF Ile in $subfile do # echo $subsubfile if ["$subsubfile" = = "$2$3/$file"] Then RM-RF $3/$file mv $subsubfile $3/$file else

Shell script if then else fi

--------------------------------------------------------------- echo "Please Y-to continue"Read ynIf ["$yn" = "y"] | | ["$yn" = "Y"]; Thenecho "Script is running ..."Elseecho "stop!"Fi Note that there are spaces oh------------------------------------

Shell Script Learning Day fourth--bash internal variables, variable main strings, variable substitution

One, bash internal variables: Common internal commands: Echo,eval,exec,export,readonly,read,shift, wait,exit, and Dot (.) are also the source commands. Command function Echo Variable Name Displays the variables

Shell script gets the MAC address of the intranet host in bulk

This shell script is used to obtain the MAC address of the intranet host of the 192.168.4.0/24 network segment in bulk#!/bin/bash#Author:Jink#这脚本使用ping和arp命令获取内网主机的MAC地址,查询到的MAC地址写入到文件中myping(){ ping -c2 -w1 -i0.5 $1 &>/dev/null if [ $? -eq 0 ]

The printf command of the shell tutorial

In the previous section we learned about the Shell's echo command, which we'll learn from the Shell's other output command printf.The printf command mimics the printf () program in the C library.printf is defined by the POSIX standard, so scripting

Shell Programming-Statements (vii)

If Else judgment statement  If statementSyntax Format 1:if condition then statement 1 Statement 2 ... Statement NFISyntax Format 2:Often used in terminal command prompt if [conditional];then statement; fi  If Else statementSyntax format:if

Summary of common methods for time operations in bash shell

In daily work, the bash shell has a very frequent time operation. For example, when the shell script sends statistics periodically, it will check whether the scheduled send time is current. Or when you use a file to save some data, a time string is

Shell script Instance-memory disk usage warning

1, disk use warning and send mail#!usr/bin/bash#df-th|grep '/$ ' This is the record that gets the memory used#后面两句是获取内存的使用率disk= ' df-th|grep '/$ ' |awk ' {print $ (NF-1)} ' |awk-f '% ' ' {print '} 'Mail_user=natashaIf [$disk-ge];thenecho "' Date

Shell programming guessing numbers game. (Master please detour)

Guess the number game. First let the system randomly generate a number, give the number a range (1-60), let the user enter the guessing number, the input to judge, if not meet the requirements, give high or low hint, guess the right after the number

Shell script--02 Modify the IP in the configuration file

1. Modify the IP in the JSON$. IP. SH '8.8. 8.1 '#!/bin/bash#localIP =$ (command)#localip= '/sbin/ifconfig-a|grep inet|grep-v 127.0.0.1|grep-v inet6|grep 8|awk ' {print $} ' |tr-d ' addr: 'forIpinch$ ( Do if[${ip} = ="9.9.0.224" ] Then

Start password for Shell application programming. Welcome to welcome.

Start password for Shell application programming. Welcome to welcome. Description: If you want to lock access to the terminal but do not want to exit and log on again, you can write a script.Program. When the script is called, you can exit only

ADB shell am Function

ADB shell am Function ADB shell am can use this command to start activity, services; send broadcast and so on from the CMD Console: C: \ Users \ Administrator> ADB shell AM Usage: am [subcommand] [Options] Start an activity: am start [-D] [-W] -D:

Windows netsh (Network shell)

Netsh (Network shell) Configure network interfaces, Windows Firewall, routing & remote access. SyntaxNetsh [Context] [Sub-context] command KeyThe contexts and commands available vary by platform, the list below is for Windows 2008.Use interactive

Shell environment and variable survival learned from the Export command

Creation: 00:49:46Author: unlinuxFrom: http://www.Unlinux.com MeI am a newbie myself. I haven't been in touch with Linux for a long time. Recently I encountered a problem when I learned the bash Export command (the book says that export is changing

Linux Shell Programming

   Shell itself is a program written in C language, which serves as a bridge between users using Linux. Shell is both a command language and a programming language. As a command language, it interactively interprets and executes user-input

Shell:. bash_profile and. bashrc)

/Etc/profile: This file sets the environment information for each user in the system. When the user logs on for the first time, this file is executed.And collect shell settings from the configuration file in the/etc/profile. d directory./Etc/bashrc:

BASH Shell (string) Operation Summary

Basically, the articles referenced below add a few items to make a record, so you are too lazy to remember them, saving you the trouble of Google every time. Http://my.oschina.net/aiguozhe/blog/41557 1. Get the length 1 STR = "ABCD"

Total Pages: 541 1 .... 154 155 156 157 158 .... 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.