"Shell script Learning" shift command learning

Positional parameters can be moved left with the shift command. For example, shift 3 means that the original $ $ is now $, the original $ $, and so on, the original $ $, $ $, $ $ no move. The shift command with no parameters is equal to shift

Linux Shell Single Instance run __linux

#!/bin/sh# **************************************************# * * * Libraries# **************************************************Source/etc/profile;Sleep 2Date= ' date + '%f_%h:%m ' If [x$1!= "X"]ThenDate=$1Fi Echo $DATE Basedir= ' DirName $ 'CD

Shell script [operator expression, conditional control statement]

#!/bin/bash #你值得收藏的四则表达式运算. val1=1 val2=1 val3=1 val4=1 val5=1 val6=1 let val7=1 ((val1++)) val3=$ (($val 3+1)) val4= ' expr $val 4 + 1 ' val5= ' bcecho ' val5= ' $val 5 echo ' val6= ' $val 6 echo ' val7= ' $val 7 You should understand the

Branches in the shell

If statementSyntax 1 If condition then command (set) fi The condition here is to use the test statement or the bracketed statement (the previous article has been summed up)Note If statement must terminate with FI Practice: #if test if ["-lt"] # "13

Linux uses shell scripts and cron to implement timed backups, uploads, and garbage-log Cleanup (original) __linux

1. Edit detailappbackup.sh Input: #!/bin/sh#copyright (c) 2010-2011 Luoch (luocheng.cn@luocheng.cn) #Backup The detail files and update, clear logs#version 0 .1.1echo "= = Start deleting logs = =" Rm-vf ' find/opt/apache/htdocs/detail/app/log-name '

Shell programming for loops __HTML5 under Linux

Linux for loops can use break and continue keywords to jump out of loops, consistent with Java usage a common for loop structure #语法一 for variable in value 1 value 2 value 3. Do program block done # #语法二 The for variable ' command ' do

Shell script Programming Basic article--Several special symbols __ programming

* Inverted quotes ' and $ () * Let's demonstrate a comparison of the output results using the inverted quotes and $ () For this result, is because the $ () in $ () has escaped to get this result because of the two \=\ in the inverted

Linux shell Programming Notes-Common find and xargs__ block chains

The Find command tool is used to locate files in the directory (or even the entire file system), search Path_name-option [-print-exec-ok] #find的一般格式; 1, Find command Options (-option) 1.1. Find files and directories by name (-name):cb@standalone14:~

Progress bar (Shell)

C. Progress bar prepared by:http://blog.csdn.net/addw1/article/details/55292922 Shell writing #!/bin/bash function Bar () { i=0 bar= ' lable= (' | ') ' \ \ '-'/' index=0 while [$i-le] do #printf ' [%-100s][%d%%][%c]\r '

Crontab and shell scripts to implement Linux timing tasks __linux

The writing of Linux shell scripts VI test.sh #!/bin/bash ################### . /etc/profile . ~/.bash_profile ################## Path=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin Cd/home/huaxia/syslog2db&&ruby app.rb

Git shell displays Chinese

Original address: http://www.cnblogs.com/Gukw/archive/2012/01/16/2323417.html 1,/etc/gitconfig:[GUI] encoding = Utf-8 #代码库统一用urf-8 to display Chinese in the Git GUI[i18n] commitencoding = GB2312 #log编码, window under the default gb2312,

shell+ Timing Task +nginx signal Management implementation log cut storage by date

We renamed yesterday's log 00:00:01 every day, placed it in a specific directory, and then USR1 the information number control Nginx to regenerate a new log file Create a new shell script under directory/usr/local/nginx/logs/runlog.shNote: The file

Use shell script to traverse all files in the folder

#!/bin/bash function ergodic () {for file in ' ls ' if [D-$ '/' $file] then ergodic '/' $file else echo '/' $file >> b fi Done} init_path= "/etc/httpd" ergodic $INIT _path Some netizens replied: "If you only traverse the directory and create an

Linux system crontab shell script to execute JAR package __crontab

-CP and-classpath Specify the paths of other classes that the class runs on, usually the class library, the jar pack, and so on Windows semicolon ";" separated by semicolons on Linux: "Delimited." Use a little "." Represents the current path

Passing the shell path variable into sed

Everyone must know how to get the sed into the shell variable However, there is a problem with passing in the path variable. #!/bin/bash export vob=/home/fesu/server sed-n '/^vob/{s/\ (vob=\). */\1 ' "$VOB" '/P} ' $VOB/scripts/build/ Makefile

Start HBase hmaster in eclise, play shell

First Master: Parameters: Run the HBase shell hbase Shell Parameters the shell that runs up after HBase Try to run a few orders to find out: Create ' T_person ', ' no ', ' name ' create ' t_person ', ' no ', ' name ' 0 row (s) in 2.

Common conditions in the Shell to judge

-B file if it exists and is a block special file, True-C file If it exists and is a character special file, True-D file if it exists and is a directory, true-e File is true if it exists-F file is true if it exists and is a rule file-G file is true

Shell Scripting day three-special variables

First, position variables: $ $ Gets the file name of the current execution script, including the script path.$n gets the nth parameter of the current execution script, 1~9, greater than 9, enclosed in {}, for example: ${10}.$# indicates the number

Shell Base 05 handles user input

1. Command-line parameters------similar to javac parameter 1 parameter 2Java-like compiled Javac parm1 ..... In the shell, the arguments are separated from the arguments by a space. Use positional parameters to identify corresponding parameter

Linux enters the history command in the shell

In the Linux shell, often input commands have a lot of similarities, even the same, if the long command, the efficiency is really very low, but can be through ctl+r, find the history of the previous input commands, it is very useful.After pressing

Total Pages: 541 1 .... 511 512 513 514 515 .... 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.