Shell for Learning

#!/bin/bash for_1 () { echo ' for 1 show item ' for var in item1 item2 ... itemn do Echo ${var}; Done } for_2 () { echo ' for 2 show 1~5 ' for loop in 1 2 3 4 5 do echo ' The value is: ${loop} '

Linux shell script periodically cleans Tomcat log files (first draft) __linux

Shell script to clean up logs ------------------------------------------------------------------------------------------------ #!/bin/bash tomcatnum=2 #清理的路径 tomcat[0]= "/usr/local/tomcat/logs"tomcat[1]= "/data/logs/tomcat0"For ((i=0;iecho "Deleting

Jenkins execute the shell command for the remote Linux system __linux

ssh

First need to go to the System Management-> Management plug-in, select the Optional Plug-in tab, search and find SSH slaves plugin plugin, click Download installation You may need to reboot the Jenkins after the installation is complete You can

Ways to get the shell script to execute automatically

Redirect Method When the shell sees #!/bin/bash GDB Help Quit Eof Pipe mode The combination of the Echo, Sleep command, and pipe operator (|). #!/bin/bash (Echo ' root '; sleep 1; Echo ' root ') | passwd Modify the root user's

Script Automatic Login shell script (compact version)

Background: Work on a variety of online machine landing scripts, and some need to log into the board before landing on the machine, and some dynamic password, each input is very troublesome, the use of automated landing scripts to manage too

Solution to the "integer expression expected" of the shell command __shell

In the shell script, when comparing with parameters, such as "[$temp-eq" IPhone "]", there may be an "integer expression expected" error. This is because these parameters:-GT,-lt,-eq comparisons are both numbers and variables, so the variable temp

Shell Bash determines whether a file or folder exists

#shell判断文件夹是否存在 # If the folder does not exist, create a folder if [!-D "/myfolder"]; Then Mkdir/myfolderfi#shell determine the file, whether the directory exists or has permissions folder= "/var/www/" file= "/var/www/log" #-x parameter to

Custom logging to a file in a shell script

Custom log functions and pre-variables# Adirname-return Absolute dirname of given fileadirname () {odir= ' pwd '; CD ' dirname $ '; pwd; CD "${odir}";} Mynam= ' basename ' $ "' mydir= ' Adirname" $ "' myhome= '/home/shell/script" mylog_path=

Shell Process Control statement case

The Linux shell has learned several times.But the memory is not good, always forget, chase the main reason may be not common reason!Case beginning Esac EndHere's the result.Input method does not enter the symbol is wrong, the beginning of the total

Shell merges two files into two columns of one file

Shell merge two files into one file two columns published: 2014-07-20 Editor: Www.jquerycn.cnShell merges two files into one file in two columns, providing two methods, generic shell script, awk script.The contents of the file are as follows:More

Crontab the reason that the shell script failed to execute at timed time

There is a period of time without crontab scheduled to perform tasks, this time to take advantage of the project implementation of the opportunity to further analyze the Crontab timing task settings encountered some difficult problems.Crontab-l View

Shell Daily Combat Dos attack

Depending on the Web log or the number of network connections, monitoring when an IP concurrent connection number or a short time PV reached 100, that is, call the firewall command to seal off the corresponding IP, monitoring frequency every 3

Shell Special variables

List of special variables variables meaning $ File name of the current script $n Arguments passed to the script or function. N is a number that represents the first few parameters. For

Shell calculation script

#!/bin/bashPrint_usage () {printf "Please enter an inteper \ n"}Read-p "Please input first number:" FirstnumWhile ["echo "$firstnum" | sed -r ‘s#[^0-9]##g‘"! =" $firstnum "]DoPrint_usageRead FirstnumDoneRead-p "Please input the operators:"

Shell syntax "If and for"

"If syntax test condition judgment Statement" go from: http://lovelace.blog.51cto.com/1028430/1211353 "while for Loop" go from: 78681117for variable in list do Command1 Command2. Commandndone can also be written as: for Var in list; Do read the

Shell Delimited string array

Tag:[1]    Array    shel   done   bash    str   class   lov   nbsp    #!/bin/bash tmp= "Test,girl,boy,love " old_ifs = " $IFS " ifs = " , " arr = ($a) IFS = " $OLD _ifs " Echo" arr[0] is: ${arr[0]} " echo "arr len: ${#arr [

Shell implementation Multi-threaded (multi-tasking)

Implementation scenario: 1. Add:& at the end of the command#/bin/Bashall_num=Tena=$(Date+%h%m%S) forNuminch`seq 1${all_num} ' Do { Sleep 1 Echo${num}}& Doneb=$(Date+%h%m%S)Echo-E"starttime:\t$a"Echo-E"endtime:\t$b"With the & symbol at the end

Pass the array in the shell script to awk

If you encounter this problem, write it in your own way. Here, only the relevant part is shown. # Getting the length of an array Array_len = "'wc-l temp2 | awk '{print $1 }''" Temp_index = 0 Declare-A array_date # Assign values to arrays in

Use filezilla and SSH Secure Shell client to upload and download files on Ubuntu through SSH

Use filezilla and SSH Secure Shell client to upload and download files on Ubuntu through SSH   L use filezilla First, start the SSH service on Ubuntu.   Sudo/etc/init. d/ssh restart   Start filezilla on Windows: For example, if the

Peanut Shell domain name experiment [personal notes, for reference only]

1. Desktop (Wireless disabled, wired dialing) Bind the free oray domain name and the dial-up IP address (change the record ). 2. The oray client is updated in time, but the ping domain name times out. The reason is that the binding has not

Total Pages: 541 1 .... 337 338 339 340 341 .... 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.