When to use the shell
Because the shell appears to be a common feature between UNIX systems, and has been standardized by POSIX. As a result, the shell script can be applied to many systems as long as it is written "attentively". Therefore, the
1. Shell function: The shell allows a set of command sets or statements to form an available block called a shell function.
A function consists of two parts: a function title, a function body.
The title is the function name. A function body is a
####### #认识shellThe common shell scripting interpreters on 1.unix/linux include bash, sh, csh, Ksh, and so on, which are used to call them a shell. We often say that there are many kinds of shells, actually speaking of shell script interpreter.Note:
1. Run the command as a specified userRunuser-work-c "Cd/home/work/uc/bin && sh start.sh"Runuser-push-c "Cd/home/push/mucs/bin && sh start.sh"Or:Daemon--user mongod "Mongod--config conf/mongod.conf"Daemon is a function name that needs to be
/******************************************************************** * Shell Global and local variables * declaration: * To So far, when writing shell scripts, often by the shell function in the variable * scope confused, so today deliberately
Transferred from: http://codingstandards.iteye.com/blog/831504Description of UseThe type command is used to display the types of the specified command. The type of a command can be one of the following
Alias aliases
Keyword keyword,
Local variables in shell scripts define functions in the shell to make the code modular and easy to reuse code. But the scope of the variables and functions of the script itself can be confusing, and here's a look at the problem. (1)The variables
FunctionCase One :#!/bin/bashHello () {echo "Hahahah"}HelloExecutes the function with the result : hahahaCase two :#!/bin/bashFunwithreturn (){echo "The function is to get the sum of the number"Read-p "Input first number" NUM1Read-p "Input second
FunctionFunctions have the same functionality:Simply put, the function of the program is to call the same part of the code in a number of parts, and then a name, so the function is called the name can be, in the modification of the code, only need
Defining functions in the shell allows the code to be modularized to facilitate reuse of code. But the scope of the variables and functions of the script itself can be confusing, and here's a look at the problem.(1)The variables defined in the shell
How is the program executed?
when the operating system starts, it waits for user action. So how does the user communicate with the operating system? How do you trigger program execution? Typically, interacting with the operating system, there
The Linux shell can be user-defined functions and can be called casually in shell scripts.The functions in the shell are defined in the following format:[Function] funname [()]{action; [return int;]}Description
1, can be with function fun ()
The above diagram is the approximate process of system call, we first call a system function named SYS_XYZ, then the glibc (GNU C function library) Shell function emits an interrupt instruction (int 0x80), and then switches from user state to kernel
Preface
Linux Shell Scripting Basics We are almost finished here, function believe that we are not unfamiliar with it, directly to the topic of it ~
Please indicate the original link:http://blog.csdn.net/u011974987/article/details/52718164This
10.1 Commond: Suppress normal shell function lookups
10.2 exec: Replacing the current shell process with the Execute command
10.3 Bash:gnu's Bourne-again shell interpreter
10.4 Builtin: Execute shell built-in command
10.5 Enable:
A shell function is a set of command sets or statements that make up an available block. Using functions can simplify scripting. The function requires that the function be defined and reused, and that it is used directly when calling the functions.
Transferred from: http://blog.csdn.net/you_jinjin/article/details/7228303Method OneFirst, under Windows, configure the Adroid environment variable (Win7 as an example)1, Desktop right button-"My Computer--" Advanced system settings2,
Turn on and off the shell feature-general Linux technology-Linux programming and kernel information. The following is a detailed description. Note: shopt is the full name of shell option.
You can enable or disable the Bourne Again Shell function
Let's take a look at the practice of an asp tutorial.
Shell functionsNamespace: microsoft. visualbasicModule: interactionAssembly: microsoft visual basic. net Runtime Library (located in microsoft. visualbasic. dll)Run an executable program. If the
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.