The shell's parent-child process

January 11, 2017, Wednesday Shell parent-child processStart/execute mode:Current shell: #!/bin/bash must start at the beginning                        the first line of #! Will be discovered by the kernel, is a magic number , the kernel will

Shell deletes empty or blank lines in the file.

Today, we found that there are too many empty lines in a file and we intend to delete them. So I used SED and checked the command to write it like this: Sed '/^ $/d' file1 I found that there are still a lot of blank lines in the output content,

BASH Shell for loops 1 to 100

Preface written using BASH Shell ProgramThe for loop is often used, especially from 1 to 100. Here we record several types of loop method classes in shell from 1 to 100. C Language For (I = 1; I In usage For I in {1 .. 100} doecho $ idone SEQ

Shell scripts randomly output 25 lines of a file

Preface I haven't written a shell script for a long time. Today I can see such a requirement in the group as follows: I also reviewed the shell script and wrote it easily. ProgramAfter testing, I basically passed the train of thought. First,

Methods called in shell scripts

Preface shell script writing can be modularized or functional. For example, test1.sh can complete an independent function and test2.sh can also complete an independent function, but test1.sh is required as the premise. Therefore, in order to save

Shell programming trap

Trap allows you to capture signals in the script. The common form of this command is: Trap name signal (s) Among them, name is a sequence of operations taken after the captured signal. In real life, name is generally a function specifically used

BASH Shell learning-array

Definition Method Subscript array direct assignment #! /Bin/basharr [0] = "one" arr [1] = "two" arr [2] = "three" for num in $ {arr [*]} doecho $ numdone Sequential assignment of parentheses Arr = ("four" "five" "six") for num in $ {arr [*]}

Use tar in Linux Shell

We encountered the following problems during package packaging using Linux shell scripts: Tar: removing leading '/' from Member names Shell Content #! /Bin/sh Pkg_dir =$ {PWD}/release Pkg_name1_release.tar.gz Tar-zvcf $ {pkg_name }$ {pkg_dir}

Several shell assignments in Linux

1. Find the number of times "Linux" appears in the file sample.txt #! /Bin/bash # How many "Linux" in linux.txt? Grep-o "Linux" linux.txt | WC-lgrep-c "Linux" linux.txt 2. Retrieve the first column (User Name) of/etc/passwd and use "the N

How to obtain random numbers in Shell

From: http://standalone.javaeye.com/blog/511101   1. Use the shell variable $ randomEcho $ random 2. Use Random Functions of awkAwk 'in in {srand (); print rand ()}' 3. Use the System Device File/dev/random and/dev/urandomDd If =/dev/random | OD-

Linux Shell programming from beginner to proficient in exercises answers after class answers (Chapter 8)

This book has no answer. If you send an email to the author, he will not provide the answer. So I had to answer the question myself. Chapter 5 5.1 Q Cai-English-1984-Jiangsu-7 Q Cai-English-1984-Jiangsu-7 Q Cai-English-1984-Jiangsu-7 Q Cai-English-19

Changing the path in Shell

You often need to switch to a common directory, but the path is long and hard to remember. You want to use a script to enter the directory, but it will never change ....... Cause analysis: When the script is executed, only a sub-process is

Cron commands in Linux & Unix shell programming guide

  1. run commands in the background Cron: System scheduling process. It can be used to run jobs during off-peak hours every day, or during different periods of one week or one month.At: Command. It is used to run some special jobs at a specific time,

Shell operations and simple programming (2)

Several Popular Shells Currently, popular shell types include ash, Bash, KSh, CSH, and zsh. You can use the following command to view your own shell types:# Echo $ Shell$ Shell is an environment variable that records the shell type used by the user.

How to compile Linux Shell script (1)

I am studying Linux Shell script recently.Linux Shell scripting tutorial (LSST) v1.05r3But because it is in English, it is also a deep impression. Now, go to the topic. 1. How to Write shell script? A. First, use any Compiler (Vi, Vim, kwrite,...)

Use shell to generate xml in simple format

The following is the shell code: Create_xml.sh #! /Bin/bash # Author: dengzhaoqun # Date: 201202/14 OUTFILE = outtabs = 0put () {echo ' $ OUTFILE} put_head () {put '? '$ {1 }'? '} Out_tabs () {TMP = 0 tabsstr = "" While [$ TMP-lt $ (tabs)]

Set shell transparency

Publicc void setalpha (INT alpha)Alpha range: 0 ~ 255 This method is supported from eclipse3.4. /*** Sets the operator's Alpha value which must be* Between 0 (transparent) and 255 (opaque ).* * This operation requires the operating system's advanced*

Common shell rules

1. system environment variables after the user logs on to the system:$ Home user's own directory$ Path: the directory to be searched during Command Execution$ TZ Time Zone$ Mailcheck the number of seconds to check whether a new letter exists$ PS1

Shell output redirection

Overview Input/Output redirection is supported in the Linux Shell environment, expressed by the symbols " ". 0 indicates standard input. 1 indicates standard output 2 indicates standard error message output 0, 1, and 2 can be used to

Uw.shell by example, 3rd Edition chapter 7th answers to awk programming chapter

Run the command awk-F scriptname filename. For example, if the first script name is bigawk. SC1, the file name is datafile # The content of datafile is the same as the previous content, so I will not post it here. You can check out the content in my

Total Pages: 541 1 .... 511 512 513 514 515 .... 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.