Shell------randomly generate three-digit numbers

write a script to generate a random 3-bit number, and can be based on the user's input parameters to determine the output of a few groups. For example, the script name is number3.sh. Execution Method:Bash 2.shproduces a set of 3-digit numbers

Shell simple Use (-) judgment

Take a few simple examples of the judgments involved1. Comparison of file-related judgments#!/bin/Bashif[$#-lt1 ] Then Echo "No file name"Exit1elif[-D $1 ] Then Echo$1is directoryelif[-B $1 ] Then Echo$1is block deviceelif[-

Shell Share mkdir command

The common options directory is present without an error (at this time there is no effect on the directory), there is the creation of mkdir-p, if there is a need to create a parent directory when creating a directory when the parent directory is

Shell Color configuration under Linux

Color configuration involves the following places (I often use): command prompt, file and directory name display, ECHO-E command1. Color values are divided into foreground and background colors, and the corresponding relationship of color code

Using the remote shell tool SSH login to the Linux host, the user name after the return to the card, 10 seconds after the prompt to enter the password

Using the remote shell tool SSH login to the Linux host, the user name after the return to the card, 10 seconds after the prompt to enter the password.Use Wireshark to catch the whole process packageBecause SSH is an encrypted protocol, it is not

Shell string Equality Comparison, note the processing when the string is empty

if ["$test" x = "Test" x]Here are a few key points:1 with a single equals sign, two equals signs can be2 Note that there is a space on each side of the equal sign: This is the UNIX shell requirement3 Notice the last X of "$test" X, which is

Linux Shell expr uses

Linux shell expr use collectors: Spring and Autumn hundred flavor the-Geneva- +|read: Go:| |share non-original, excerpt from: "Linux and Unix Shell Programming Guide"17.5expr Usage The expr command is generally used for integer values, but can also

Prevent long execution of shell scripts resulting in SSH timeouts

In some scenarios where security requirements are high. SSH timeout is pre-set by the administrator, after idle for a period of time SSH connection will be actively disconnected.This scenario assumes that the script runs through SSH and the script

Linux Shell ls-1 column display file

spl

/******************************************************************************* * Linux Shell Ls-1 Column Display file * Description: * Sometimes when writing shell scripts, it is often necessary to list the files in a column, and then the * for

Install JDK in Linux and Tomcat and shell scripts to shut down the started process

Enter UNAME-A in the command line mode, for example, when the interface shows i386 that the Linux system is version 32, download the corresponding JDK version on the official website, or load it directly onto my network disk

Shell color and show git branching configuration

# ubuntu terminal under command line Color configuration # parses out the branch name from. Git/head:find_git_branch () {local dir=. Headuntil ["$dir"-ef/]; Doif [-F "$dir/.git/head"]; Thenhead=$ ( usage: Append the above code to the ~/.BASHRC file,

Shell echo Command

Shell echo Command echo"It is a test"The double quotes here are completely omitted.3The . Display variable read command reads a line from the standard input and assigns the value of each field in the input row to the shell variable #!/bin/SH read

Shell "Distribution System"

The first part: expect explanationExpect allows us to automatically log on to remote machines, and can implement automatic remote execution of commands. Of course, if you use key authentication without a password, you can also implement automatic

Shell Basic usage

#!/bin/bash #使用哪个shell执行echo "Hello World" username= "Tom" echo $username #chmod +x./test.sh settings can perform file #for loop output for skill in Ada coffe Action Java; Do echo "I am good at ${skill}script" Done#for file in ' ls/etc '; Do#echo

Raid and one of the Mdadm commands (including shell display font color, etc.)

Write a script:1) display a menu to the user:d| D) show disk usages.m| M) show memory usages.s| S) show swap usages.QUIT|Q) quit.2) Display the appropriate content when the user is given an optionWhen the user chooses to complete, displays the

Shell script: Bulk Modify file name (delete characters in file name)

Shell script: Batch modify file name (add character in file name)The previous article on the bulk modification of the file name (the file name of the addition of characters), the work also exists such a requirement, batch modify the file name,

Linux Shell Interactive Walkthrough

--stdin indicates that a standard input can be made with any fileExpect its main function is to add a shell to the SSH process to pass the interactive instructions.Its core is the spawn expect send setSpawn calling the command to executeExpect waits

Questions about the shell script settings suid.

I wrote a script quit.sh, as follows:1 #/bin/bash2 If [$#-lt 1];then3 echo "must input at least one parameter!"4 Exit 15 fi67 if [= = "Q"];then8 echo "quit!"9 echo "$ (WhoAmI) quit @ $ (date)" >>/tmp/quit.txt #这里访问了quit. txtExit 0One elseecho "Wrong

Shell bulk SSH free Interactive login host

Scripting features: Batch or single SSH-free login authenticationScript scenario: When deploying a cluster, most implementations want to configure the management node with SSH-free login from the node, writing the following script to simplify the

Writing your shell is actually very simple.

Quote: I have not written a shell script before, perhaps because of laziness, perhaps not forced to write to the point of the shell. However, some time ago, the job requirements, required to rerun a few months of the script, these scripts are timed

Total Pages: 541 1 .... 293 294 295 296 297 .... 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.