How to test the correctness of shell scripts

In the actual work, the shell script needs to be tested for correctness.How to test in the quickest and most effective way?A lot of development habits are, apart, write/Get, run a, see input, output, want to do the operation is completed, also

Shell script Programming {2} per day

redirect$echo "Test Redirect" > Temp.txt--Writes the output to the Temp.txt,temp.txt file is first emptied.$echo "Test redirect Second" > Temp.txt-Append the output to the temp.txt.File descriptor0--stdin Standard Input1--stdout Standard

Little Ant learns Linux (9)--shell Basics and bash basic features

Shell Simple UnderstandingView the current SHELL echo $SHELLTry the first little script: Vim test.sh1 #!/bin/bash2 echo ' I'll be-back ';Note: #!/bin/bash This sentence is bound to add, remember. How to execute the script:1. Give execute permission,

Shell script standard Output

1. REDIRECT standard output (stdout) and standard error output (STDERR) to two different files respectivelywhere the symbol ' > ' defaults to the standard output redirection, meaning and ' 1> ' the same, ' 2> ' indicates a redirect standard error

Shell script Try it a little bit

package.sh #!/bin/bashfor i in ' cat $ ' do echo $i >> resultdpkg-l | grep $i | Sed-n 1p > Tmp//awk read out all the data after the fifth column awk ' {for (i=5;i> result//the error content of the script Directed to a file in sudo dpkg--purge $i >>

Shell 13 Ask

1) Why is it called a shell?From the user's point of view, the user is not able to directly manipulate the kernel, but through the kernel "shell" program, known as the shell, to communicate with kernel.1 different operating systems use different

Call the shell script in Qt and monitor the returned method

In Qt, you often invoke external commands or execute shell scripts, and you want to analyze the execution results.Qprocess runshellprocess =new qprocess (this); // Monitoring of invoking process outputs This , SLOT (Readprocess ())); Connect (

The shell thing.

Which language is most helpful to you in your daily work? I think it's a non-shell. The earliest contact with the shell should be in college, such as the Linux file system cut will use some commands, such as Find, tar, Xargs, CP and so on, and put

Shell Script Summary 2

Echo ' seq-s ' 10 '--command to use anti-quoteecho $ (seq-s "" 10)(())LetExprBC--Features support for fractional counting$[]----------[Email protected] ~]# ((ruan=1*8-9))[Email protected] ~]# echo $ruan-1---------[Email protected] ~]# b=$

Some points to note about the function of shell programming

This morning a friend suddenly QQ asked, shell programming function why return can only be an integer, how to return the execution of the function and save to a variable. In fact, this problem is very good to solve---only need to seriously

Log cut Backup (test) shell script

#!/bin/bashcd= ' df-l |awk ' nr==3 {print $4} ' |awk ' BEGIN {fieldwidths= ' 2 1 "} ' {print '} 'If [$CD-ge 20];thenecho " hard disk space is full and cannot be backed up " | Mutt-s " backup alarm, please replace the hard drive in time " [Email

[Shell advanced] The most bull B Linux shell Command (ii)

1. Use your favorite editor to tap the command command After the command has been knocked out, press , will open an editor you specify (such as Vim, through the environment variable $editor specified), which is the

X-shell Key Login Method collation

1. First, log on to the remote Linux server, such as 192.168.127.222, with the normal password login method;2. Click the Key Generation Wizard in the tool:650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/74/67/wKioL1YcmyPy22e-AAI3RPggo2A573

Shell Learning: sed command

  Http://blog.sina.com.cn/s/blog_a56ef5490101cn58.htmlSed is a good file processing tool, itself is a pipe command, mainly in the behavior of the unit processing, you can replace the data rows, delete, add, select and other specific work, the

Shell Learning Example One

Enterprise Face question 1:Use the For loop to create a batch of 10 files in the/oldboy directory, with the name in turn:Oldboy-1Oldboy-2Oldboy-3......Oldboy-10Hint: In the future to test everyone file prefix is also random, the end is a number

[20150925] Linux file system and shell-Zhu Xiaoyang

Introduction to Linux file system and Shell file system Ext2/ext3/ext4EXT2 is the standard file system in the Gnu/linux system. This is the most used file system in Linux, which is designed specifically for Linux, with extremely fast speeds and

Shell Script Integer Comparison

1. Integer comparison -eq equals, such as:if [ "$a"-eq " $b"] -ne not equal to, such as:if [ "$a"-ne " $b"] -GT greater than, such as:if [ "$a"-gt " $b"] -ge greater than equals, such as:if [ "$a"-ge " $b"] -lt less than, such as:

[Reprint] "Shell script" line-by-row processing of text files

Transfer from http://www.cnblogs.com/dwdxdy/archive/2012/07/25/2608816.htmlThe style files are often processed on a line-by-row basis, how to get each row of data in the shell, then process the row data, and finally read the next row of data, loop

Shell Programming Basics

For C in a B C D E F g;do echo $c; Done sequentially outputFor C in a B C D E F g;do tar czvf install.log. $c. tar.gz Install.log; DoneFor C in {a.. g}; do echo $c; Done the same as aboveSeq 1 10 columns of numbersFor i in {1..10}; do echo $i;

Shell base-bash variable-user-defined variable

Variable setting rules:Variable names can consist of letters, underscores, and numbers, but cannot start with a number.The default type of a variable in bash is a string type, and if a numeric operation is required, specify the variable type as

Total Pages: 541 1 .... 478 479 480 481 482 .... 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.