Processing of parameter processing-shell incoming parameters
$#The number of arguments passed to the script
$*Displays all parameters passed to the script in a single string. Unlike positional variables, this option parameter can be
Shell command:The shell recognizes three basic commands: Built-in commands, shell functions, and external commands:The built-in command is the command executed by the shell itself. Some orders are built on the basis of their necessity, for example:
Syntax: eval cmdlineEval will scan the back of the CmdLine two times , if after the first scan, cmdline is a normal command, then execute this command;If the cmdline contains an indirect reference to a variable, the semantics of the indirect
There are a bunch of host addresses:A.baidu.com...Z.baidu.comHow to extract the. Baidu.com letters from these data, such as: a b...z?When you see the problem, you first think about how to generate the file with a script:Ideas:1. Definition suffix:
Resources: Linux shell script Raiders author Sarath Lakshman People's post and telecommunications pressShell: Reads the contents of each line of the file and outputs the notation 1Purpose: Read the passwd file, get the user name and its default
#!/bin/bash#1, determine if the service is available 2, do not use restart TOMCAT#*/30 * * * */home/wsm/restart.sh >>/home/wsm/restart.log# Stop tomcatfunction Killtomcat () {pid= ' ps-ef | grep "/home/wsm/bin/tomcat" | grep-v grep | awk ' {print $}
Work fast two years, to Cnblogs also nearly two years, high-touch, but also at least into the program Ape Army.Finally opened the blog (do not laugh, belly ink is too little, are looking at the study of the Great God).I don't know what to
Reprint Please specify: Http://blog.csdn.net/wujysh1. View the values of the environment variables defined by the user shell under the current system.2. Define the value of the variable AK to 200 and display it on the screen.3. Define the value of
When you use Hadoop or deploy Hadoop, you often encounter situations where you want to copy files to other machines, but if the individual writes, it happens that the cluster is large and exhausting, and now uses an awk to write shell scripts that
A shell script is typically a one-time execution of the entire file, meaning the entire file is equivalent to the main function. But I just want to run the specified function. In fact, you can run using the function name as a parameter to run, it
Shell Background Run Programhttp://blog.csdn.net/courage89/article/details/10561041
& is most often usedThis is used at the end of a command, you can put this command in the background to execute
CTRL + ZYou can put a command that is
Linux Shell && | |
shell returns a return value when executing a command that is saved in the shell variable $? In When $? = = 0 o'clock, indicating successful execution; = = 1 o'clock, which indicates that the execution failed. Sometimes, the
If the leader tells you to check the company when you're off duty. Those PCs are open, one to see? NO, it's too much trouble. The following script can quickly find the surviving PC through the ICMP ping packet, it is important to note that the local
1. Enter HBase Shell[Email protected]:~/hbase-0.98.8-hadoop1/conf$ hbase ShellHBase Shell; Enter ' help ' for list of supported commands.Type "exit" to leave the HBase ShellVersion 0.98.8-hadoop1, R6cfc8d064754251365e070a10a82eb169956d5fe, Fri Nov 17
1), the definition of the array (self-dividing):Static array= (123)Dynamic array array= ($ (command))Example:array= ($ (LS)) echo ${bb[@]} color01.sh color.sh ip.sh touch.sh tou.sh user.sh while01.sh while_02.sh2), display the contents of the
MacOSXRAMDisk (memory disk) Shell
This article provides the ghost version of Mac OS X RAM Disk (memory Disk) Creation Program and practical instructions.Concerns
When Mac thunder downloads, The IOPS is too high. It may be because the cache is not
Linux shell programming process control, linuxshell
If statement:
Test is used in the past.
Example 1: When the hard disk exceeds 80%, notify the Administrator
Example 2: Automatically Restart Apache when it is disabled
Example 3:
Summary of the use of shell scripts and the use of shell scripts
(1) The csh script can call the bash script, and vice versa.
(2). How to call variables and functions defined in other scripts.
(3). Defined variables. The default value is global
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.