In Linux, the execution of a script can help us save a lot of time, for the execution of the script it is understood by the individual, it is the same as the beginning of the file #! Bin/bash through the VI editor to create a new executable file,
Take the length of the variable
[[Email protected] scripts]# var=oldboy123[[email protected] scripts]# echo ${var}oldboy123[[email protected] scripts]# echo ${#var}9# For example: #以下判断用read输入一个值, if the length is 0, The value is empty,
#!/bin/sh# Describe:check the real server status# history:2015-08-25 22:21:38# Author:timPath=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/binExport PATHvip=192.168.1.121dip=192.168.1.112rip= ("192.168.1.122" "192.168.1.123")Vport=8
Emptying files with shell scriptsIn recent projects, a lot of log files are generated, so you need to write a script to empty them manually, here are a few typical ways.Method 1 Code#!/bin/bash##方法1echo "" > $1echo "$1 cleaned up."RunDescriptionI
Talk about the function call, I believe that everyone will not be unfamiliar, but for the beginner shell of me, Shell function call Way is a bit let me not very accustomed to, I also go a lot of detours, because the transfer of parameters when a
unset directive: Delete the specified shell variable or function"Syntax" unset [-fv][variable or function name]"Feature description" the directive functions primarily to delete the specified shell variables and functions."Parameter description"
The new version supports the Windows 10 operating system. Please click on the link in the top left corner of this blog page to download.Blogger's computer recently upgraded to the Windows 10 operating system, the use of a few days will not open the "
Method 1:#!/bin/bashuser= ' cat iplist.txt ' pass= ' cat Passwd.txt ' echo $USERSSH () {while Truedo x=$1;shift;y=$2//Note s Hift, if the shift operation is not performed, the value of $ $ will not change.
Hbase Shell DetailsHBase provides users with a very convenient way to use it, which we call "HBase Shell."The HBase shell provides most hbase commands, which can be easily created, deleted, and modified by HBase shell users, as well as adding data
The script comes from----a work unit #脚本是错误的, and I've corrected it when I work. work in the time I found a inexplicable script I think the script writes a lot of errors ~ let's see where the error is
The Helloword of the shellCd/binLs-l | Find-name SHLs-l | FIND-NAMD BashLs-l | Grep-r sh sh is actually pointing to dashlrwxrwxrwx 1 root root 4 2014-12-11 03:13 sh, dashLs-l | Grep-r BashCD ~mkdir ShellVI hello.sh#!/bin/bash//fixed notation,
When using the shell to pass parameters.Do not use shift when parsing parametersAction= "$" case "$action" in status) shift [email protected] exit $? ;; .. *) help exit-1;; EsacBecause even if there are double quotes, it cannot be passed
SIGHUP: This signal is generated to the control process when the terminal disconnects. 1Sigint:ctrl-c or delete is pressed, generated by the terminal driver and sent to all processes in the foreground process group. 2SIGKILL: Causes the program to
Open a text editor, create a new file with the extension sh (sh for Shell), the extension does not affect the execution of the script, see the name of the good idea. #!/bin/bashecho"Hello world! " ""#!" is a contract tag that tells the system what
Shell, that is, the hard skin, when the thickness of the shell and its surface rate radius of less than 0.5, known as the "thin shell", the reverse is called "thick shell." Chest armor evolved from shells, shields.In a world of computers that is
Environment variable configuration file for Shell programming,
I. Introduction1. Variable type:User-Defined variables (local variables)Environment variables: Define the operation environment for each user. The learned paths and ps1 are used. To
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.