Step One:
Locate the session information for the specified user, and draw up the execution script:
#!/bin/ksh
echo "conn Sys/sys as SYSDBA
select ' Alter system kill session ' ' | | Sid | | | serial# | | | ' From sys.gv\ $session where
[Root@centos65 liumengyang]# cat test.sh
#!/bin/sh
#if The process Exists,kill it
pid=$ (Ps-ef|grep java| awk ' {print $} ')
pidname=$ (ps-ef|grep java|grep-v ' grep ' |awk ' {print} ')
#judge If the process is Running.if Not,restart.
If
http://www.51testing.com/?uid-45739-action-viewspace-itemid-185211
JoinSimilar to the Join method in db, there is also a left join right join INNER JOIN, etc.Specifies the way the join is specified by the parameter-A.-A1 represents a row that
Here are two ways to use the shell's regular expressions. use method One:
#赋值给变量var
read var
#定义regex正则表达式
regex= "[0-9]"
if [$var =~ $regex]];then
#match
#do Something
fi
For example, to match the input, the requirement must be a number
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
Cut-and
The Cut command extracts text columns from a text file or text stream.
Cut syntax
[root@www ~]# cut-d ' delimited character '-f fields
The PATH variable is as follows
[Root@www ~]# echo $PATH
/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/
The 1.expr command is generally used for integer values in the general format:
Expr argument operator argument
The general usage is to do arithmetic operations using expr, such as:
[Root@centos ~]# expr 10 + 20
30
$expr 30/3/2
5
(Note that operators
how hbase is accessed1. Native Java API: The most conventional and efficient way to access;2, hbase shell:hbase command line tool, the simplest interface, suitable for hbase management use;3, Thrift Gateway: The use of Thrift serialization
first, built-in variables
1. $BASH
The path to the bash's binary program file (the path to the script interpreter)
$ vim test.sh
Enter the code:
#!/bin/bash
Echo $BASH
To run the code:
$ bash test.sh
2. $FUNCNAME
The name of the current
The Bash command explains that the package program contains some internal commands. Internal commands are invisible in the directory list, and they are provided by the shell itself. Common internal commands are: Echo,eval,exec,export, ReadOnly, read,
Recently looking at the script inside the OpenWrt, with too handsome, the following 2 parameters extended expression of large use, all recorded.
${parameter:+expression}
If parameter has a value and is not empty, use the value of
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
Checkpid: Check if PID already exists, if one exists, return 0 (by viewing the/proc directory)Daemon: Start ServiceKillproc: Kill a processPidfileofproc: Finding the PID of a processPidofproc: Ditto, use the PIDOF commandStatus: Returns the state of
The previous writing test program used scripts to raise interest, combined with specific cases, to test the results of learning. Finally understand a slightly more complex shell script. There are still a lot of technical things in there.
Declared
seq 1 100The notation of the seriesWc-l count Rows-C bytes-W wordsbasename returns a basic file name for a stringDirName leave the non-directory part except the file nameRead-p "" Name prints a hint and waits for input input information to be given
PM2:Start ----- pm2 Start/bin/www-watch stop ----- pm2 Stop app_name| app_id Display LogView port occupancy and force the release of occupied portsSometimes when the software is turned off, the background process dies, causing the port to be
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