Shell restricts user input criteria

1. Must enter the pure digit, ignores similar ' 2 ' ' 3 ' the number with the space input before and after2. The digital range must be controlled in 10 ~ 90 #!/bin/bash status= ' err ' start=10 end=90 while [$status!= ' OK '] do ifs= ' read input

Shell Scripts Automate installation

In a Linux environment, automate installation steps for multiple packages: 1, find the software package, extract the name of the package to establish the decompression path (in order to let us more clearly find our files) Pkg= ' Find

Shell script handles text files && space transformation lines line by row

Reference: http://www.cnblogs.com/dwdxdy/archive/2012/07/25/2608816.html Often to the stylistic document for line-by-row processing, in the shell how to obtain each row of data, and then processing the row of data, and finally read the next line of

Shell string Matching

Question: How does the shell judge a filename to start with a character ~ Solve: #var = "cn get the length of me" #$1:parameter 1 to judge the name of the file Var=$1 Iscn=false # ${var:0:2} takes the Var substring from the No. 0 character and

Modifying a row record in an XML file with a shell script

Modifying a row record in an XML file with a shell script As before, suppose the following XML file: Web.xml has the following contents: cookieName sessionName Requirements: Now you need to replace the value of cookiename with a shell

Shell Scripting Interaction: Automatically entering passwords

Usually in the console input commands such as: sudo, SSH, ftp or modify the admin permissions of the file will require input password, but in the She ll script to run the process of how to automatically enter the password. Below is a summary of

(shell) Rman backup script

1. Fully prepared (including control documents) [Oracle@centos6 scripts]$ cat rman_backup.sh source/home/oracle/.bash_profile Rman target/log=/home/oracle /backup/backupall_rman.log 2. Support for full-library and incremental backups

HBase Common shell commands

1, view namespace Hbase>describe_namespace ' Ai_ns '2, List all namespace Hbase>list_namespace, 3, Create a table under namespace Hbase>create ' ai_ns:testtable ', ' FM1 ' the management of the table 1 See what tables are available

Count source code Lines shell script [00 original]

Today I wrote a shell script that counts the number of source lines in a directory, as follows: #!/bin/bash Find. -Name *. Java > Srcfilespathname Count = $ (wc-l srcfilespathname) # Record the number of source files echo "Number of source

Shell Sort Command-sort

The sort command sorts multiple rows of data in a behavior unit.For example, there is a text file Test_sort, which has five elements, using the sort command, the five elements can be sorted in dictionary order from small to large.If the sort command

QuickStart Shell Scripting (ii)

Last time I wrote the shell, I found that VI and VIM are different: Vim is the upgrade version of VI, it is not only compatible with all VI directives, but also some new features in it. Vim is much more useful than VI. This time the last content,

Shell, Bash, and terminal configuration files

Shell--command parser, also a programming languageBash-a specific instance of the shell, zsh, bash are instances of the shell The "Echo $SHELL" command can be used in the terminal to view the shell instance currently in use and can be switched to

Shell Script Execution Dailybuild

#!/bin/bash destmailslist= ("xxx@xxx.com"); Build_dir=g3_asic_yocto Log_file= "G3_asic_dailybuild.txt" Tail_file= "./tail.txt" #CurTime =$ (date "+%y%m%d") daytimetag=$ (date "+%y%m%d") montimetag=$ (date "+%y%m") yesttag=$ (date-d ' 3 days ago ' +

Extract files and shell scripts that combine large numbers of small files

zip

The script file name is unzip-batch.sh# bulk unzip the compressed file, unzip the file to the specified directory#!/bin/bashFor zipfilenamefull in ' ls./*.zip 'Do#echo "$zipfilename"Zipfilename= ' basename $zipfilenamefull 'filename=$ (basename

Hadoop Learning Notes (15)---the use of Hbase shell commands

1. Start HBase, go to the Bin folder under the HBase folder, and then execute the command: HBase Shell [Root@hadoop0 bin]# hbase shell hbase shell; Enter ' help ' for list of supported commands. Type "exit" to leave the HBase Shell Version 0.98.12.1

Hill sort (Shell sort)

This sort looks more difficult than bubbling selection, inserting, and logically complicated. Intuitively, I know this is not simple, a little afraid. There is no way to give yourself a hint of psychology, be sure to read the 8 basic sorting

Shell Process Control

Unlike Java, PHP and other languages, SH's process control is not empty, such as (the following is the PHP Process Control notation):PHP if (Isset ($_get["q"]) { search (q);} Else { // don't do anything }You can't write this in Sh/bash, and

First knowledge of the shell

First, the shell concept shell本身是一个用C语言编写的程序,它是Linux系统的用户界面,提供了用户与内核进行交互操作的一种接口。shell既是一种命令语言,又是一种程序设计语言。作为命令语言,它交互式地解释和执行用户输入的命令;作为程序设计语言,定义了各种变量和参数,并提供了许多在高级语言中才具有的控制结构,包括循环和分支。 它虽然不是Unix/Linux系统内核的一部分,但它调用了系统核心的大部分功能来执行程序、建立文件并以并行的方式协调各个程序的运行。

Shell scan on the same network segment surviving host

This example takes the class C address as an example, if it is a Class A or class B address, the script can be modified slightlyIpaddr= '/usr/sbin/ip a | grep $1 | grep inet | awk  ' {print  $2} ' netmask= ' echo ${ipaddr} | awk -f  '/'   ' {print $2

Create a shell script

First step: Use a text editor to create a text file The first line must include the shell declaration sequence: #! #!/bin/bash Add Comment Comments start with # Step two: Run the script

Total Pages: 541 1 .... 394 395 396 397 398 .... 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.