Write shell program
Execute shell program
Shell programs have many features similar to C and other programming languages, but they are not as complex as programming languages. A shell program is a series of Linux commands and utilities stored in a file. During execution, e
Location parameters
Internal Parameters
Just as the LS command can accept directories and other parameters as its parameters, parameters can also be used in shell programming. Parameters in Shell programs include location parameters and internal parameters.3.1 Location Parameters
The parameter provided by the system is calledLocation parameters. The value of th
. The result of the run method can end normally, but the original code had to get the console output information of CMD, while the runIt is not convenient to obtain the console information. At last, you can only redirect the console information to the file, and then the program is reading the information.
For more information about the parameters, see msdn.
Http://msdn.microsoft.com/zh-cn/library/ateytk4a (En-US, vs.85). aspx
Exec method (Windows
Vim creates a new shell file, such as my file named Java_run, which reads:
echo "Please enter the Java file path you want to compile:"
Read Path
#分离路径和文件名var1= ' dirname $path ' #路径Var2= ' basename $path ' #文件名CD $var 1Javac $var 2Java ${var2%.*} #去掉文件名的后缀
RM ${var2%.*}.class
OK, save quit vim.
chmod 777 Java_run #加可执行的权限
run the script,./java_run.
extension: If you want to make it your own comm
Tags: Ges Configure ace Col%s distinction is machine blogFirst, Shell script introductionShell scripts to write well, you must continue to practice writing to write well, there is no shortcutTo have a general idea of a script when we get a demand, think of how the need to achieveShell scripting can greatly improve our productivitySecond,
[[Email protected] shell]# date +%y year, 4-digit2018[[Email protected] shell]# date +%y year, 2-digit18[[Email protected] shell]# date +%m Month04[[Email protected] shell]# date +%m M, number of minutes57[[Email protected] shell]# date +%d13[Email protected]
The following content is based on the Linux bash Environment
There are many ways to run shell scripts in Unix. Suppose there is a script that can be run called test. sh. You can add the script file name, source test. sh (= .. /test. sh two .), you can also use. /path/test. sh mode. If the script is in the path, it can
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
our operational efficiency
How should the shell write?
Get the demand, have a specific idea, expand the demand link, start writing the shell
20.2 shell script Structure and execution1 Creating a shell directory, followed by a
Tags: linux os centos shell scriptNote content:
20.1 Shell Script Introduction
20.2 shell script Structure and execution
20.3 Date Command usage
20.4 variables in a shell
Shell Script Introduction
Shell is a scripting language Aming_linux (public number) blog.lishiming.net (blog)
You can use logical judgments, loops, and other syntax
Functions can be custom-defined
The shell is a collection of system commands
Shell scripts can be
Tags: shellShell Script IntroductionShell is a scripting language blog.lishiming.net (Amin blog, you can go inside to find the shell problem)You can use logical judgments, loops, and other syntaxFunctions can be customized to reduce duplication of codeThe shell is a collection of system commandsShell scripts enable automated operations, which can greatly increase
Tags: Shell script Introduction shell script structure and execute date command usage variables in shell scriptFirst, what is the shell?
The shell is a scripting language aming_linu
What is a shell?The shell is a scripting language aming_linux blog.lishiming.netYou can use logical judgments, loops, and other syntaxFunctions can be custom-definedThe shell is a collection of system commandsShell scripts enable automated operations, which can greatly increase our operational efficiencyShell script st
Learning bash notes-debugging shell programs and learning bash shell
In shell, the simplest debugging assistant outputs the echo statement. Many echo statements can be put into the code for debugging, but it takes enough time to locate
The information to view. You may need to output a lot to find the information you wa
1. When the shell script executes the Python script, you need to use the return value of the Python script to determine the command to be executed by the following program
Example: There are two py programs hello.py
Copy Code code as follows:
def main ():
P
Shell script learning and shell script1111111111111 clear the simple command script of the messages log file under/var/log/Var/log/the system file under the log file must have the root permission:$ UID is the global variable of the system:Make make install indicates that the previous step is successful.Make | make ins
Test switch and special parameters in Shell script, shell script1. Test Switch
The following table lists the meanings of the test commands and whether they can be used in test commands, bash, and ksh.
Switch
Test
Bash
Ksh
Definition
-A FILE
Supported
Supported
Only files exist
-B FILE
Supported
Supported
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.