Example of shell generation random password in Linux

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.

Shell comparison of two decimal size methods

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

Shell REDIRECT Input

#!/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

Shell programming 100 lines per day

[Email protected] ~/tscripts $ echo"Hello World!"-bash:!": Event not found[Email protected] ~/tscripts $ echo'Hello World!'Hello World![email protected]~/tscripts $ echo'Hello World!'>>t1.sh [email protected]~/tscripts $ cat t1.sh #!/bin/Bashhello

Shell Basics-Variables

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

Shell script Execution Conflict event-ssh&while

Today we find a problem: Read the following script: [email protected]/0 # cat ! $cat  /tmp/test_nginxls *.txt |  tr  '   '   ' \ n '  | while read linedo echo  $lineif  [  ' Yes '  ==  ' yes '  ]thenssh  192.168.109.10  ' echo  ' yes ' "elsessh  192.

Bash Shell analog Password input

function inpasswd {Read-s-P "Enter you Password:" Passwd1EchoRead-s-P "please Check Password" passwd2Echoif [[$passwd 1 = = $passwd 2]]Thenecho "correct" && exit 1Elseecho "Incorrect"echo "Please Input Agin"Fi}Count=1While TrueDoIf [$count-GT

Shell Script Review Little Exercise

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

Shell script Application (i) case

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

Chinese and English double quotes in the shell

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:

Shell to scan LAN IP

# 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"

Shell Usage Records

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

linux-Start stop restart Shell simple Shell example

Stop it:#!/bin/bashPid= ' Ps-ef|grep/opt/lampp|grep-v Grep|awk ' {print $} ' |wc-l 'B=0If [$pid-gt $b]ThenPs-ef|grep/opt/lampp|grep-v Grep|awk ' {print $} ' |xargs kill-9echo "LAMMP has stopped!"Elseecho "LAMMP is not running!"FiStart:#!/bin/bashPid=

Shell LVs Startup script

[[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#------------------------------------

Shell loops, simple little exercises

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="

Shell's log processing

#!/bin/bash#by lc at 20160428 for hadoop (grep_recharge) DATE= ' Date +%F_%H\:%M\:%S ' ytdate= ' date -d  " -1 day"  +%y%m%d ' restdir=/home/hadoop/prodata/restdatedir=/home/hadoop/ prodata/rest/$YTDATERESTFILE =${datedir}/recharge-$YTDATE.

Java invokes shell commands and scripts dedicated to Hadoop/spark clusters

ObjectiveNote that this blog post is based on the following blog posts, based on them, dedicated to my big data

Python3.5 Day3 Job One: Implement a simple shell sed replacement function

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.

Eight sorting algorithms of the two-hill sort (Shell's sort)

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 Hill (Shell) sorting method

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

Total Pages: 541 1 .... 522 523 524 525 526 .... 541 Go to: GO

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.