Path to the LS Etc/init.d/shell scriptls/usr/local/apache2/Ls/usr/local/apache2/bin/apachectl1. Shell FeaturesOrder history!! !$!n! characterTab key to complete file path or commandAlias a= "B" Unalias AWildcard * Matches 0 or more characters? Match
Judging variablesRead-p "Input a word:" WordIf [!-n "$word"] ; thenecho "You had not input a word!"Elseecho "The word you are input is $word"FiJudging input parameters#!/bin/bashif [!-n "$"]; thenecho "You had not input a word!"Elseecho "The word
If you want to start a shell script in a terminal session, and then have the script run in background mode until it finishes, you can use the Nohup command, even if you quit the terminal session. The feeling of Nohup is to initialize a process to a
1.if-then#!/bin/bashIf date if the command runs successfully (exit code 0), then the command in the then section is executedThenecho "Good"Fi2.if-then-else#!/bin/bashIf HunterThenecho "Good"Elseecho "bad" if statement in exit code not 0, execute
> If the file does not exist, as above, if the file exists, clear the file first, then fill in the file with the data>> If the file does not exist, a new file is created and the data is sent to the file, and if the file exists, the data is added
Directly on the code:#include "apue.h" #include int main (void) { char buf[maxline];/* form apue.h 4096 */ pid_t pid; int status; printf ("percent"); /* Print PROMT (printf requires percent to print%) * /while (Fgets (buf,
/proc File Systemthe /proc file system in Linux consists of a set of directories and files , mounted ( Mount) with the /proc directory .The/proc file system is a virtual file system that provides an interface to the kernel data structure in the
As mentioned above, the shell is a scripting language, so there must be an interpreter to execute the scripts.The common shell scripting interpreters on Unix/linux include bash, sh, csh, Ksh, and so on, which are used to call them a shell. We often
The MAC server needs to turn on Telnet first. Open with: System Preferences, share check remote loginCommon commands are:Copy (copy the native file to the remote server) Scp-r Local path/file userName@192. 168. XXX. XX:/tmp#userName为远程服务器用户名称,
Before the directory installed on the OpenFire encountered this problem, and today again, you need to modify a folder under all subfolders and files of the three permissions: Read and write to the user, the administrator read and write, all read and
1. Truncation function file=dir1/dir2/dir3/my. file.txt ${file #*/}: Remove the first/its left string: dir2/dir3/my. file .txt${ file ##*/}: Take out the last/and left string: my.file .txt${ file #*.}: Take out the first. and its left string:
1. String judgmentSTR1 = str2 When two strings have the same content, length is trueStr1! = str2 True when string str1 and str2 are not equal-N str1 True when the length of the string is greater than 0 (string non-null)-Z str1 True when the string
#!/bin/sh#auto Change IP netmask Gateway scripts#wugk 2012-12-17Cat ++++++++ automatically modifies IP and host name information +++++++++Ethconf=/etc/sysconfig/network-scripts/ifcfg-eth0Hosts=/etc/hostsNetwork=/etc/sysconfig/networkdir=/data/backup/
4. Input and output#! /bin/bash# Read users input and then get his nameread"Please input your first name: " firstNameread"Please input your last name: " lastNameecho-e"Your full name is: $firstName $lastName"Read usage:read[-ers][-a 数组][-d
#common. SH, which is mainly some function # perform compiled cleanup work function make_clean { # $RE _ins based on the value of the variable, To determine whether to perform cleanup work if [ $RE _ins == 1 ]; then make clean >/dev/
The script is: nohup/mnt/nand3/h2000g >/dev/null 2>&1 & for & 1 more accurately said file descriptor 1, and 1 The general Representative is Stdout_fileno, which is actually a dup2 (2) call. He outputs the standard output to All_result, and then
The test command usage. Function: Check file and compare value 1) Judge the expression if test (expression is true) if test! expression is false test expression 1–a expression 22 expression is true test expression 1–o expression 22 expression has a
First, the Bash Shell Basic Operations Command 1.type: See if the command is a built-in command of the Bash shell type cd2.Echo: The display of the variable echo $ variable echo name3.unset: Cancels the variable you just set unset name4.Envor SET
Background:The items that are built daily are placed in different folders by date. As today's construction is put into 2015-06-01, tomorrow's will be put into 2015-06-02, and so on. Long time, need a script to delete the folder N days ago. (In this
Fly2015Pecompact Shell is not heard of the shell, the need to shelling the program is my love crack training of the first lesson of elective assignment four. Recently a bit addicted to shelling, of course, also suffered from shelling frustrated
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