Today's example is used to validate the legality of the parameters entered by the user, and the program is not complicated, as follows:
#!/bin/sh
# validalphanum-ensures that input consists only of alphabetical
# and numeric
The shell case is simpler, but it has its characteristics.
#!/bin/sh
# scriptbc-wrapper for ' BC ' which returns the result of a calculation.
if [$ = ' P ']; Then
precision=$2
shift 2
else
precision=2 # default
fi
bc-q
Script
The hosts one-click Deployment Script under Linux Environment, @lstoars contribution; @fluviusmagnus provides an enhanced version.
Official website: https://github.com/racaljk/hosts/tree/master/hosts_tools
#!/bin/sh # # Script_tool_for_linux #
Having recently been using the Linux operating system and being familiar with some simple commands, I'll introduce you to some of the less-known but very useful commands:
1.mtr command to view the direct network connection of a MTR running host and
Tomcat is started randomly, so you have to manually open Tomcat when you start the server, otherwise you won't be able to access it (said online can be set up with the server open, I will not ni ...) )
1: Find the Tomcat installation path
How to calculate the number of files and directories in the current directory
# ls-l * |grep "^-" |wc-l----to count files
# ls-l * |grep ' ^d ' |wc-l-----to Count dir
How do I just column subdirectories?
Ls-f | grep/$
In Linux, the/proc/$PID/status file provides the usage of the process resources (memory, stack, semaphore, child parent process), although Linux provides a lot of commands to view memory, but it's all about the overall usage and cannot view the
There are shutdown, halt, reboot, Init for Linux down and restart systems, and their internal processes are different for them.
Another year, into 2010 years, in the last year maybe Microsoft grabbed the halo of Linux, but for the development of
command function : Cutting files, cutting files in units of behavior or in bytes
command Syntax :
Split [–help][–version]
Split [-][-l , in number of rows
Split [-B ][-c
The output file name refers to the cut file as a prefix.
1. Cutting
Summary
SEO optimization of the first step is to let spider spiders often come to your site to patronize, the following Linux commands can let you know the spider crawling situation clearly. Below we analyze for Nginx server, log file
Function Fly Shovel is simpler, just get the extranet IP. Some sites are processed for Curl UA.
Meet their own collection of addiction, collected a lot can be used to query the Internet IP URLs and methods.
#国内某网站的接口, only return IP
Curl ip.665
Simple Google a bit, not fruit, so sent an email for advice, and soon have a reply.
Copy Code code as follows:
Path = "C:\test.jpg"
arr = Split (Path, "\")
FileName = arr (Ubound (arr))
FolderPath = Left (path, Len (path)-Len (FileName)-
&&Command 1 && Command 2: If this command executes successfully && then execute this command.[Jb]/usr/xxxx/ytcclb>ls-l Test.sql-rwxr--r--1 xxxx Group Nov 14:12 Test.sql[JB]/USR/XXXX/YTCCLB>CP test.sql Test.bak && echo "Coping file ok!"Coping file ok!
A shell script that backs up a database
Copy Code code as follows:
#!/bin/bash
#指定运行的脚本shell
#运行脚本要给用户执行权限
Bakdir=/backup
Month= ' Date +%m '
day= ' Date +%d '
Year= ' Date +%y '
Hour= ' Date +%k '
min= ' Date +%m '
Implementation: SSH remote login, each time to specify a bunch of user names and passwords, is required to implement automatic login.Login process: Local A first log in to B and then log on to the final C
As follows:
Copy Code code as follows:
Sign up for a system service to boot from.
1 Script Authoring
#vim test.sh
Copy Code code as follows:
#!/bin/bash
#description: hello.sh
#chkconfig: 2345 20 81
exec_path=/usr/local/
exec=hello.sh
daemon=/usr/local/hello.sh
Shell version Nginx log spider crawl View script
Change the path of the Nginx log before usingIf more spiders themselves in the code Spider UA array Riga can
#!/bin/bash
m= "$ (date +%m)" Case
$m in
"") m= ' before ';;
") m= ' Feb ';;
"
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.