The detailed user of date can refer to the followingHttp://www.cnblogs.com/xd502djj/archive/2010/12/29/1919478.htmlThe specific use of date can be viewed in another post, "Shell Date command Detail" http://blog.csdn.net/runming918/article/details/722
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]
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#------
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
1. CycleThe shell loops and executes a program continuously until the condition is met. Loops are divided into 4 types, while loops, until loops, for fixed processing, for numeric processing.2. While loopThe while loop is executed until the
Defining functions in the shell allows the code to be modularized to facilitate reuse of code. But the scope of the variables and functions of the script itself can be confusing, and here's a look at the problem.(1)The variables defined in the shell
Give you a full, you in the Linux environment to try to understand more:The execution name of this program$n the nth parameter value of this program, n=1..9$* all parameters of this program, this option can have more than 9 parameters.$# the number
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
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
Because the shell appears to be a common feature between UNIX systems and is standardized by POSIX. As a result, shell scripts can be applied to many systems once they are "written attentively". Therefore, the reason to use shell scripts is based on:
The execution name of this program $n the nth parameter value of the program, n=1..9$* all parameters of the program, which can be more than 9 parameters. $# the number of parameters for this program $$ the PID of the program (the current process ID
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
First, I want to process many documents in a folder in batches. These documents save the data I want to process, because pig is a beginner ,, so I don't know how to load data in batches, and I haven't written it.
Your UDF can only load files one by
Basic usage of hbase Shell
Hbase provides a shell terminal for user interaction. Run the hbase shell command to enter the command interface. Run the HELP command to view the help information of the command.
The usage of hbase is demonstrated using
Shell script to replace the tomcat cluster war package
Run the command to log on to the server without ssh.
The configuration file does not change much to overwrite the previous configuration.
Profile configuration file
Bak =/home/wsm/bakWebapps
A linux shell script that modifies the configuration file,
Not long ago, I found a Blog reading the configuration file.
Now, you need to set up an interface for users to modify similar configuration files through the web interface. The big way is to
Use shell commands to analyze statistics logs and shell commands to collect statistics logs
When you need to collect user log information and analyze user behavior, you can use shell to conveniently retrieve a lot of data and place it in excel for
In linux/centos shell scripts, the password is not interactively modified. In centos, the password is not modified.Today, when I wrote a shell script, I found that the user's password needs to be set and the password is set to interactive. This is
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