Shell script learning notes ----- command execution, script learning notes
1. PATH variable: the main function of shell is to execute the command entered by the user. For example, after the user inputs a "ls" command, the shell will find the file corresponding to the command and execute it. Usually, shell sets an environment variable named PATH, which stores a series of directory names used to find command
Linux obtains the absolute path of the script in the shell script. Script Name: a. sh location:/tmp/whuang/study/java Script content: www.2cto.com Shell code #! /Bin/sh this_dir = 'pwd' dirname $0 | grep "^/">/dev/null if [$? -Eq 0]; then this_dir = 'dirname $ 0' else dirname $0 | grep "^ \.">/dev/null retval = $? If [
Recently, a project has changed the original Sybase Database to an Oracle database. Therefore, I want to change the Sybase script to an oracle script, such as a table structure, stored procedure, and view script. this script change may take a long time before it can be encountered. Put it in the blog, and you need to c
Linux Servers build FTP service scripts (tested on centos6.5 and CENTOS7) (the script does not make a judgment and needs to clean up the environment itself) (the script only allows uploads to not allow downloads, and does not allow anonymous users and local users to log on)Installation scripts#!/bin/bashSource/etc/rc.d/init.d/functions#安装vsftpdRpm-q vsftpdIf [$?-ne 0];thenYum Install-y vsftpdFi#备份主配置文件Cp/et
Index is a powerful weapon to improve database query performance. No index, just like the library without book tags, find a book they want to book than Heaven is difficult. However, in the process of using the index, especially in the case of batch DML, the corresponding fragments will be produced, and the B-tree height will change accordingly, so that these changing indexes can be refactored to improve performance. N long ago Oracle advised us to periodically rebuild the indexes on those tables
In Java,python, you can use the import method to make calls between scripts or modules, for example:
Copy Code code as follows:
>>> Import Math
>>> Math.sqrt (4)
2.0
How do you invoke other shell scripts in the shell, or variables in other scripts, functions?
Method one:. ./subscript.shMethod Two: source./subscript.sh
Attention:
1. Between two points, there are spaces, you must pay attention to.2. Two scripts are not in the same directory, use absolute path3. For
This article from Baidu Encyclopedia.
What is a shell.
The shell, to be exact, is a command-line interpreter, and its role is to follow a certain syntax to interpret and pass the commands that are entered into the system. It provides users with an interface system-level program that sends a request to Linux to run a program, and the user can start, suspend, stop, or even write programs with a shell. The shell itself is a program written in C language, which is a bridge for users to use Linux
Tags: port way background native let DBN terminal delete MySQL script#!/bin/bashhostname= "127.0.0.1" #数据库本机地址PORT = "3306" username= "root" password= "pwd" dbname= "Tbs_ra_data" Execsql= "Call Delete_flow_onebyone ()" //here can be an SQL statement or invoke a stored procedure echo "Begin execute MYSQL SQL ... "Mysql-h${hostname} -p${port} -u${username}-p${password} ${dbname}-E" ${execsql} "Echo " End Execute MYSQL SQL ....... ... "
1. Simple script file hello.sh, the content is as follows#!/bin/bashpwdls-alExecute script: Bash hello.sh or use the root command:./hello.sh2. Accept user ParametersThe name of the script file executed by $ A$* on behalf of all user parameters$? Represents the return value after the last command was executed$ #代表总共多少个参数$n represents the value of the first paramet
MySQL backup script, MySQL script
mysqlbackup.php:
Php//backup MySQL Set_time_limit(0); Date_default_timezone_set (' PRC '); //Configuration $configs=Array( ' Host1 ' =Array( ' localhost ', ' root ', ' root ',Array(),//back up all databases as empty, or back up those databases' D:/xampp/mysql/bin/mysqldump ',//Backup Tools dirname(__file__)." /localhost ",//Director
Shell script entry, shell script
There are two ways to use Shell script:
① Interactive: each time a user inputs a command, the Shell immediately executes the command;
② Batch: You can compile a complete Shell script to execute many commands in the script at one time.
View t
Pass parameters to the script (1). Pass parameters to the script
In awk, the most confusing thing is to pass parameters to the script. The parameter assigns the value to a variable, which can be accessed in the awk script. This variable can be set on the command line and placed behind the
Using the LoadRunner recording script, the recording process also displays "recording ..." and has (XX events). However, after the script recording is complete, there is nothing in the script and no code is displayed. Workaround: In the script Recorder vu Generator, click "Tools"--"recording options", "Network"-"port
10 websites that provide free PHP script download and 10 free php scripts. 10 websites that provide free PHP script downloads and 10 free php scripts. This article will focus on the free resource download site for 10 PHP scripts. We previously recommended 16 popular websites for downloading cool scripts 10 websites that provide free PHP script downloads and 10 fr
There are a lot of functions in my PHP script that call someone else's interface, but these interfaces are sometimes very slow, which will cause my script to time out and report "504 Gateway Time-out" on the page!
I want to abort the function that called the interface before the PHP script times out and return to the page with a hint, but I don't know how to k
Java6.0 adds a very practical package: javax. script, which is a new Java operation script package. With this package, we can perform operations on the script language, such as modifications or calls, and interact with the Java language, if we make good use of it, we can use it to implement some frequently-modified parts, so that we can write some algorithms into
One, how to use the CS1.5 script
First find the location of the CS game files on your computer, what? I don't know? To give you an easy way to get you on your CS desktop shortcuts
As shown in figure:
Right-click > Properties > Find target
Point to find the target, you will see the CS folder
Some scripts are put into the inside, specifically which folder inside, you slowly look down.
You're going to download a
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.