The difference between the &&export statement function &&su and Su-the variable problem of the Linux shell

Let's start by looking at the variables.[Email protected] ~]# dhh=1[Email protected] ~]# echo $DHH1Open a child shell test[Email protected] ~]# bash[Email protected] ~]# echo $DHHNo valueUsing the Export method[[Email protected] ~]#

Linux shell script output with color text

Linux shell script output with color textThe color of the text terminal can be generated by using the ANSI unconventional character sequence.Example: "Echo-e \033[44;37;5m BLUE \033[0m""Echo-e \033[44;37;5m BLUE \033[0m BLACK"The area that needs to

Linux Shell Common Tips (vi)

bz2

12. Sort commands for Rowssort:1. Sort command-line options: Options Describe -T Separators between fields -F Ignore case when sorting based on character -K Define

Shell script while read line causes the loss of tabs

Description: Although the problem is not big, it is really disgusting. My goal is to process access logs. Logs are separated by \ t for easy processing. data needs to be filtered and processed. I don't want to filter it into a temporary file and

Several tips in BASH Shell

1. for arithmetic operations. There are several assignment methods: Let a = 1 + 2Echo $ A = $(3 + 3 ))Echo $ A = $ [4*4]Echo "$" Set $ [A = 5*5]Echo "$" 2. Determine whether a directory exists:If [-d "$ (PWD)/.../candpointer"]; thenEcho "

Linux learning materials, Linux learning books (Entry books, shell programming) recommended

Here we recommend a few Linux books and good tutorials to help learners avoid detours. It can make boring things fun. Isn't it?   First recommended entry-level books: Laruence's Linux basic learning for Private food (3rd) It explains Linux in a

Shell scripts create users in batches and generate random passwords

Requirement: create 10 SYSTEM account oldboy01-oldboy10 in batches and set to generate password (different password ). Implementation script: #!/bin/bash#Question3for i in $(seq -w 10)do        useradd -s /bin/bash oldboy$i        echo "password$i" 

Shell script Practice Notes (5) -- build an image server for resources

Background:Access to Site Resources outside China is sometimes very slow. an occasional download is certainly tolerable. It is a wise decision to build an image site for multiple use or internal use by a small team.This section uses the yum source

The shell script automatically restarted after the monitoring process crashes in linux

========================================================== ========== This article is the original khler, and the original author information and the original link of this article must be kept completely and completely reprinted. Author: HeYuanHui E-

Use SharpShell to quickly implement Windows Shell Extension

After the CLR in-process side-by-side feature is introduced in. NET 4, we can use C # To compile Windows Shell. We can find related examples In Microsoft's All-In-One Code Framework. There are also several articles about it In the yard: Windows

Two shell scripts for network card Traffic Statistics (using ifconfig)

Code 1: Copy codeThe Code is as follows :#! /Bin/bash # Network card Traffic Statistics # Link: www.jb51.net # Date: 2013/2/26 N = 10 DateRm-rf/tmp/ifconfig_logWhile ($ n> = 0 ))DoN = $ ($ n-1 ));Date>/tmp/ifconfig_logIfconfig

Shell programming Basics

1. Introduction to file typesLinux mainly includes the following seven file types: d directory-common file l symbol link s socket file B device file c character device file p name pipe File 2. Regular ExpressionRegular Expressions are very important

Shell script for monitoring disk usage (local + Remote)

Monitordisk. sh: Copy codeThe Code is as follows :#! /Bin/bash # Updated: PM By: leif (liangliwen@163.com) EMAIL =/usr/local/bin/email /Bin/df-h>/tmp/df.txt USE = 'df-H | grep-o [0-9] * % | grep-o '[0-9] \ +'' For I in $ USEDoIf ($ I> 95 ))Then$

JavaScript uses Node. js to write Shell scripts.

eol

Access Parameters You can use process. argv to access the command line parameters. It is an array containing the following content: [NodeBinary, script, arg0, arg1,...] That is to say, the first parameter starts from process. argv [2]. You can

The third day of linux Shell Study Notes

Day 3: Select Conditions Outline Application Instance Analysis Conditional Test If... Else... Fi Case... In... Esac Implementation menu: After the script is executed Press 1 to display the current time Press 2 to display the CPU load Press 3 to

Delete duplicate files in linux shell with only one copy

#! /Bin/bash# Name: remove_one.sh# Purpose: Find and delete duplicate files. Only one sample is retained for each file.# Sort and output files by sizeLs-lS | awk 'in in {# Obtain the total number of the first row and discard it. Read the next

Linux shell capture Error Log script

Background any program running will inevitably generate a lot of logs, of which error logs need to be the most concerned. In some cases, the error log and the normal log are separated, but our system does not. What's more troublesome is that one log

Write shell scripts to monitor hosts

Write SHELL scripts to monitor hosts 1. Run the vi command to create a script file sysmon. sh in the/root directory: The content is as follows: #! /Bin/bash Dug = $ (df-h | grep "/$" | awk '{print $4}' | awk-F % '{print $1 }') Cug = $ (expr 100-$

Chapter 5 Study Notes of Linux Command Line and shell script Programming

$ Cat test.txt line1line2line3line4 $ Sed-I '/line/{n; d}' test.txt $ cat test.txt line1line2line3line4 $ Sed-I '/line1/{n; d}' test.txt suzhaoqiang @ suzhaoqiang-OptiPlex-380 :~ /Android/source/linux_learned $ cat test.txt line1line2line3line4

Array learning in shell

Because the application of shell is not too long and has never touched on arrays in actual projects, we need to convert something like a = 1, 2, 4, and so on today. We used awk to retrieve them separately. So today I want to see if there is a better

Total Pages: 541 1 .... 233 234 235 236 237 .... 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.