Shift can be used to move position parameters to the left.Shell's name is $The first argument is $Second argument $Nth parameter $nAll parameters $@ or $*Number of parameters $#
Shift default is shift 1Take the example below:
Copy Code code
Take a look at the contents of the original file:
Copy Code code as follows:
Root@localhost ~]# Cat File.txt
Hello World
A:b:c-h-N
A:b:c-h-N
SED deletes related rows based on conditions:
Copy Code code as follows:
Components used to query IP addresses
Copy Code code as follows:
wget http://rfyiamcool.googlecode.com/files/nali-0.1.tar.gz
Tar zxvf nali-0.1.tar.gz
CD nali-0.1
./configure && make && make install
The steps and Nginx are
The problem is as follows
Input: Pointer to node C in list A->b->c->d->e
Output: no return value, but new list becomes a->b->d->e
Answer:
Thought for a long time did not think out, read the hint to know the solution. Here's a little trick. To remove
1. A streamlined script for automating the deployment of systems, with the main function of cleaning up all directory logs
2. According to the given log directory, delete time combined with crontab to clean the log, clean up after completion, after
Linux hardware devices in the/dev directory, the optical drive is one of them./dev/cdrom represents the optical drive, the method of mounting the optical drive is as follows (in root):
Copy Code code as follows:
Mkdir/mnt/cdrom
The core server ran a bunch of scripts, procedures, it is inevitable that sometimes zombie process, dead or alive in the occupied resources there, initially just wrote a keyword to kill the process of the Linux shell script, and later found that
Copy Code code as follows:
#include
using namespace Std;
void Shellqin (int a[],int N)
{
int GAP=N/2;
int i,j;
for (; gap>0;gap=gap/2)//Set the initial gap, according to the Gap group, Gap in accordance with GAP/2 decline
{
After the
Not long ago I saw two interesting commands in the book--script and Srciptreplay, which can record a terminal session in a file, that is, we can create a command-line video tutorial through a terminal session, or we can share session files with
The script is mainly from the defined NTP server list to get the server address to synchronize, if the first unsuccessful, will continue to change the address to sync! Not perfect place also please point out!
Copy Code code as follows:
#
Question: Https://www.jinshuju.net/f/EGQL3D
Language: Shell (Bash)Operation mode:SH num-game.sh digit 1 digit 2 Number 3If you do not want to use the method of passing numbers, you can modify num-game.sh line 9th tonum=$*Tonum= ' number 1 digit 2
Recently in the debugging server iptables, oneself made a timed turn off iptables, but at night home rarely open a computer, so can not go to start iptables, of course, you may say, why not cancel timed shutdown iptables, I can only say that
The main purpose is to restart the background of more important processes, if the use of killall-9 forced kill, may cause problems. such as database processes. The code is as follows:
Copy Code code as follows:
#!/bin/sh
If [-Z "$"];
Shell Array Description:
Copy Code code as follows:
Array variable definition:
$ arr= (1 3 6 8 2 5 9 0 7 4)
Get first element by default
$ echo $arr
By subscript access, the second element of the array below, the shell array
Recently saw a group of people chatting to their server has recently been Hung horse, and then want to use a script to monitor the Web directory changes in real-time files, that is, the directory of additions and deletions to the corresponding log
This article describes the implementation of the core file automatic generation configuration method, the following steps:
1. Edit the Environment configuration file, let the shell start automatically set Ulimit
Vi/etc/profile
ulimit-c
Sometimes, because of the architectural design or other business itself characteristics, resulting in some applications using CPU is very uneven, so business processing concentrated on one CPU, while the other CPU idle sleep. Here is a simple
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.