Tags: Ash programming Daquan status Session $ home Directory str ReferenceYou can encapsulate the shell script code in a function so that it can be used more than once anywhere in the script.17.1 Basic Scripting functionsFunction: is a block of script code that can be named and reused anywhere in the code.17.1.1 Creating a functionThere are two types of formats: Name is the function name1)Function name{Comm
What is a shell script, first of all it is a script, and not as a formal programming language, so to speak is that the shell script is a collection of commands.All custom scripting recommendations are placed in the/usr/local/sbin/directory, and the benefits are easy to manage and maintain, and facilitate later handover to your replacement administrator.The struct
How to use PHP as the Shell scripting language
Probably a lot of people have thought of using PHP to write some timing letters and other programs, but there is no way to execute PHP on a regular basis;As we all know, PHP is a very good dynamic web development language (fast, short development cycle ...). )。 But only a very small number of people realize that PHP can also be very good as the language of wr
How to use PHP as the Shell scripting language
Probably a lot of people have thought of using PHP to write some timing letters and other programs, but there is no way to execute PHP on a regular basis;As we all know, PHP is a very good dynamic web development language (fast, short development cycle ...). )。 But only a very small number of people realize that PHP can also be very good as the language of wr
: This article describes how to use PHP as a Shell script language. For more information about PHP tutorials, see. We all know that PHP is a very good dynamic web page development language (fast speed, short development cycle ......). However, only a few people realize that PHP can also be a good language for writing Shell scripts. When PHP is used as a language for writing
The Until loop executes a series of commands until the condition is true. The Until loop and the while loop are just the opposite of the processing mode. The general while loop is better than the until loop, but at some point it is only rare that the until loop is more useful.The Until loop format is:Until Commanddo Statement (s) to being executed until command is TruedoneThe command is usually a conditional expression, and if the return value is false, the statement in the loop body continues
Script This article originates from: http://phpuser.com Author: y10k translation (2002-10-15-06:02:00)
--English Original: Darrell Brogdon, published in Http://www.phpbuilder.com/columns/darrell20000319.php3)
Many people may have wanted to use PHP to write some of the regular mail, such as the program, but there is no way to execute PHP on a regular basis; when I went to Phpbuilder, I found this article, so I want to give you a translation (at the same time make some changes), I hope to be usef
libraries or programming components; scripting languages: Using an interpreter to invoke the selected external application; classification according to the program's writing specification: Procedural language: program = instruction + data centered on instructions, around instructions The function realizes the design data and the data structure, the information is the instruction service, the algorithm and the instruction realization form:
We all know that PHP is a very good dynamic web page development language (fast speed, short development cycle ......). However, only a few people realize that PHP can also be a good language for writing shell scripts. When PHP is used as a language for writing shell scripts, it is not as powerful as Perl or bash, but he has a good advantage, especially for peopl
As we all know, PHP is a very good dynamic web development language (fast, short development cycle ...). )。 But only a few people realize that PHP can also be a good language for writing shell scripts, and when PHP is the language that writes the shell script, he's not as powerful as Perl or bash, but he has a good advantage. Especially for people like me who are
shells for bash on the current system and the default shell is
/sbin/nologin's Users
and statistics The total number of users under various types of shell, showing the results in the form of: Bash,3user,they
Are:root,redhat,gentoo Nologn,2user,they are:bin,ftp
Copy Code code as follows:
#!/bin/
Positional variables (parameters)Position variable $1,$2,..../file_test.sh/etc/fstab/etc/inittab;$1:/etc/fstab; $2:/etc/inittab;shift: pops up the first argument in the argument list, which is equivalent to the shift popup in the array; Shift N: Indicates that n parameters are popped at a time, #判定: receives a parameter, if an existing file shows OK, if it does not exist, displays no Such file eg:$#: shows the number of parameters, $*: Parameter list [emailprotected]: parameter list; [[email
Tags: rectangle exp Specify nohup How many exit sed take out rowThis article mainly introduces examples of shell programming First, the logical judgment if statement 1. Judging the age?[[emailprotected] 9_1 ]#cat iftest.sh
#!/bin/bash
read -p "Please input your age:" age
## 判断用户输入的必须是数字
if [[ "$age" =~ ^[0-9]+$ ]];then
true
else
echo "Please input digit"
exit 10
fi
## 判断用户的年龄,并输出相应的信息
if
Simonsu
Blog
Comment Wall
Reader Wall
Link
About
The SH scripting syntax in LinuxPlaying Linux all know the convenience of SH script, but how to write sh script is a novice and rookie problem like me. It is one thing to be able to write, and not to know is another. Holding a good study, the spirit of day up, we have time to see it, no harm. Here's a copy of a large section of the SH script's syntax description. Look slowl
We all know that PHP is a very good dynamic web page development language (fast speed, short development cycle ......). However, only a few people realize that PHP can also be a good language for writing Shell scripts. When PHP is used as a language for writing Shell scripts, it is not as powerful as Perl or Bash, but he has a good advantage, especially for peopl
. So what's the feature of this bash?1) Record command historyThe commands we've knocked on, Linux will be recorded, and presets can record 1000 historical commands. These commands are saved in the. bash_history file in the user's home directory. One thing you need to know is that commands that run in the current shell are saved to the. bash_history file only when the user exits the current
1 shell overviewThe shell is a command interpreter that provides the user with an interface system-level program that sends a request to the Linux kernel to run the program. The user can start, suspend, stop, or even write some programs with the shell.The shell is a powerful programming language that is easy to write, easy to debug, and highly flexible. The
Tags: Shell linux bash Tutorial script videoThe shell is a bridge between the user and the Unix/linux operating system. The user can either enter command execution or use shell scripting to do more complicated operations. In the
Tags: access CHM shell programming intercept help command define variable exp variable define current directoryFirst, prefaceThe shell is a program written in C that is a bridge for users to use Linux. The shell is both a command language and a programming language.A Shell is an application that provides an interface t
Try to make your work more efficient, write scripts, and use scripts, often with less effort. So, take some time today to learn about shell scripting.--------------ahead of the high-energy warning, this article is written slightly entertain, if you have to look uncomfortable, please go to the top right corner----------------------The shell has two ways of executi
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.