To generate a more unordered and complex password, write a script that generates a random password, which is usually done by using the following commandCat/dev/urandom | Head-n 1 | md5sum | Head-c 16All right, no, no, just go straight to the script.
Are English abbreviations, know the meaning of English is very good to remember.Unequal-ne (not equal)Greater than-GT (greater than)Less than-lt (less than)Greater than or equal to-ge (greater than or equal)Less than or equal to-le (less than or
#!/bin/Bashnc_start="NC 192.168.76.227 9999"LOOP=100000 for ((i=0;i)) Do eof$ieof DoneThe above example is an example of a call to the NC command to send data to a listening port.Here Nc_start is just an example, before EOF is a variable name
The difference between source test.sh and./test.sh is that source can use the variables of the test.sh script after the script is executed, and./test.sh, its variables can only be used in scripts.Variables can be divided into global variables, local
1. Change the suffix ". sh" suffix to ". Shell" under the/OPT directory (including subdirectories)2. Renaming files A1, A2, A3 files in directories A, B and C to A4, A5, A63. How to change the AA string in the file to BB in the VI
Case One• Write a login welcome script for ROOT to report the number of processes in the current host, the number of logged-in users, and the disk usage of the root file system.1. Using the VIM command in the /root directory is a new script file
When you replace characters in text with SED, you accidentally add a Chinese double quotation mark when the character is added, and when the result is replaced, you cannot always replace it.The file name is called A.txt and the text reads as follows:
# Vim/mysh/ipscan.SH #!/bin/bash# Scan the local alive ipaddress# .- the- -if[-F $filename]; Then Echo "The file is exist" forNinch{ -..106}; DoHost=192.168.0. $nPing-C2 $host &>/dev/NULL if[ $? =0]; Then Echo "$host is up"
1. Entering a child shell after using parentheses does not have an impact on the current shell.root#/opt/lxb/dir1# (CD/OPT/LXB/DIR2;PWD)Execution only returns a directory of/OPT/LXB/DIR2, but the current shell is still in Dir1.2, Linux under the TAB
[[email protected] scripts]# cat lvs_start.sh#!/bin/sh#----------------------------- ---------------#Author: created by zhangyiling 2016-06#mail: #Function: this scripts function is lvs start|stop#version:4.1.2#------------------------------------
1. The array is full of positive integers greater than 0, using the shell to find the maximum, minimum, and average values (2 decimal places reserved)650) this.width=650; "src="
Demand:1. Enable Python to have the SED replace function in shell.#!/usr/bin/env python#_*_conding:utf-8_*_#the SYS module is used to pass parameters, and OS modules are used to interact with the system.ImportSys,osold_file= Sys.argv[1]new_file= Sys.
The hill sort was proposed by D.l.shell in 1959, and the relative direct ranking has been greatly improved. Hill sort is also called narrowing the incremental sortBasic idea:First, the entire sequence of records to be sorted into a number of
4-7 shellsort.c1#include 2#include"4-1 createdata.c" //function to generate random numbers3 #defineArraylen 10//number of data elements that need to be sorted4 voidShellsort (intA[],intN//Hill Sort5 {6 intd,i,j,x;7d=n/2;8
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