Verify read/write files in Linux Shell

#! /Bin/shsrc_file = $ 1dst_file = $2 # cur_time = $ (Date "+ % H: % m: % s") # end_time = '09: 00: 00 'cur _ date = $ (Date "+ % Y-% m-% d % H: % m: % s ") end_date = '2017-08-25 14:58:00 '# end_date = '2017-06-01 08:31:00' cur _ datestamp = $

Array and traversal in Linux Shell

When using shell in Linux, arrays are occasionally used for convenience. The declaration method of the array is: Array = (element1 element2 element3... elementn) That is, wrap the array elements directly with parentheses, and separate the array

A database adds a large amount of random data (shell scripts)

During this period of time, I was engaged in big data research. Where should I find a large amount of data? Well, some automatic generation tools on the Internet do not meet my own needs, so I wrote one myself, A script that can generate a large

How to use shell scripts to implement automatic Telnet

Many people think that, like passwd and Su, Telnet cannot work automatically through pipelines and input redirection, but in fact Telnet supports input redirection. although, strictly speaking, shell scripts cannot enable telnet to enter the

Linux Shell change

Digress: Recently, due to an attempt, we installed and set the highly recommended zsh to replace the default Bash. After a while, we found that there were a lot of things, but the same problem was also exposed, for example, there is a problem with

Third-party practical shell tool set for unix linux

  The third party is ours.   1. Path The environment variable $ path does not wrap the line, and it looks very difficult. Path outputs the $ PATH Branch Echo-e $ {path //:/'/N '} 2. classpath Similar to path Echo-e $ {classpath //:/'/N '} 3.

Search for shell scripts that replace text in multiple files in Linux

Use Find and SED # First query the number (sed-N) Find.-Name '*. htm' | xargs sed-n'/old/P' # Replace (sed-I) Find.-Name '*. htm' | xargs sed-I's/old/new/G' Use grep and SED Grep-l old *. htm | xargs sed-n "/old/P"Sed-n'/old/P' grep-l old *.

Shell script usage Summary

Document directory 1. Use of shell Array 2. awk Array Operations 3. shell parameter problems 4. How to output single quotes in awk 5. Methods for connecting awk and shell strings 1. Use of shell Array Value assignment: All = (6 5 4 3 1 8 9 10)

Powerful query character matching commands and shell scripts in Linux

Variable: Local variable: valid only for the current Environment variable: valid for both the current shell and sub-shell Export A = 3 define a as a variable and assign 3 to A = 3 Export a reference does not need to be added & Export also views

Use shell scripts to automate your own micro-Linux! (1)

Two days ago, I wrote about how to use the host RedHat system to streamline, call, and modify the system to create a tiny Linux of my own! See: http://blog.csdn.net/wei2856059/article/details/6654801   However, many people are lazy ~~, So I

Example: Obtain the user name and password manually entered through the command line in BASH Shell

Sometimes in bash shell, we need to obtain user input information, such as user name and password. The password cannot be displayed... In the face of such requirements, the practical command read can be implemented. Read-P "input your Username:"

Echo dependencies of an installed RPM package over Linux BASH Shell

Script: #! /Bin/bash # file: rpmdeps. Sh # Set-xrtval = 0; export rtvalcd 'dirname $ 0' workdir = $ PWD; export workdirtest! -Z "$1" | {echo "error, RPM name is required. "Exit 1} tmpfile = 'mktemp/tmp/known_rpms.xxxxxx' | {echo" error, $ tmpfile

Shell monitors what commands others input after Logon

  PS1 = "'whoam' @ 'hostname':" '[$ PWD]'HistoryUser_ip = 'Who-u am I 2>/dev/null | awk '{print $ NF}' | sed-E's/[(

Several common shell commands

How to extract the line Content Code specified by the file: If you only want to view the first five lines of the file, you can use the head command,For example: Head-5/etc/passwd If you want to view the last 10 lines of the file, you can use the

Some special $ headers in Shell

$0 script execution name $ N the nth parameter value of the script, n = 1 .. 9 $ * All parameters of the script $ @ All the parameters of the script (which have similarities and differences with $) $ # Script parameter count $ PID for Script

Shell record time

Shell has two built-in variables about time,You have never used it,I have never used it,Today is also the first time to see,So I added a note,For future reference.$Seconds: the time when the script has been run.(In seconds).$TmoutIfTmoutThe

Sed in Linux Shell notes

This document describes the basic usage of sed. We recommend that you take a look at the details of SED and awk In the third edition. Sed matches the regular expression to output the command to process the text, it is a headache to be unfamiliar

Linux Shell Io redirection

I. Io Devices Io is the source and destination of the index data, which are called standard input, standard output, and standard error output. Programs do not have to worry about device issues, such as files, terminals, and tape drives.   By default,

Linux Shell learning notes 8

Ninth cycle Basic Syntax: While command Do List Done   Single Row format: While command; do list; done   For example: X = 0 While [$ X-LT 10] Do Echo $ x X = $ x + 1 Done   While loops are most commonly used to check whether user input is obtained

Monitor shell operations using undisclosed Functions

Monitor wwwa.applevb.com by using undisclosed Functions In Windows, there is an undisclosed function shchangenotifyregister. You can add it to the system message monitoring chain in your window. This function is available in Delphi.Is defined as

Total Pages: 541 1 .... 335 336 337 338 339 .... 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.