Shell script learning-eye protection programming experience

After I recently changed Ubuntu, I felt dizzy and eye bloat easily. Because I installed eye protection software on Windows, the screen lock will automatically prompt users to rest their eyes at regular intervals. Google hasn't found an

How to use remote shell (rsh)

The rsh command is short for remote shell. This command starts a shell on the specified remote host and executes the command specified by the user in the rsh command line. If the user does not provide the command to be executed, RSH uses the rlogin

Automatically Telnet shell scripts and execute scripts on remote machines

Simple usage #! /Bin/sh (sleep 10; echo "username"; sleep 10; echo "password"; sleep 10; echo "PWD"; sleep 50; # echo exit) | Telnet $ IP Connect to the remote machine and check the current directory. Username/password is the username and

In Linux, write a monitoring log and mail shell.

Back_day = 'date-d' 1 day ago '+ % Y-% m-% d' Finance_linux_log_user =/home/admin/output/logs/user Target_server = "crmfinance1 crmfinance2 crm-finance03"Target_gov_auto_draft =$ {finance_linux_log_user}/govautodraft. log. $ {back_day}Target_gov_

How to use shell to read files row by row

When learning Linux shell scripts, one of the most common errors is to useFor(For line in $ (cat file.txt) do ...) Read files row by row. The following example shows the result. File file.txt content: Cat file.txt This is the Row No 1; This is

Use shell to test the script or command driver.

#! /Bin/bash Compile = gccTest_filename = driver. cTest_filename_base =$ {test_filename % .*}Test_basename = test # Echo and run the specified commandEcho_and_run (){Echo $ @Eval $ @ If [$? -Ne 0]; thenExit 1Fi} ######################################

Difference between $ @ and $ * in Shell

$ @ Refers to all command line parameters. Each parameter is enclosed "" $ * Indicates all command line parameters   The following procedure: Test1.sh ------------------- Sum = 0For VaRIn "$ @"DoLet sum = sum + $ VaRDoneEcho "sum = $

Several Methods for getting string substrings in Shell

(1) substr in awkSubstr (source string, start index, length) Start index starts with 0Example:Awk '{$ A = substr ($, 2); print $ A;}' filenameAssume that only one row in the file is abcdefg, the returned result is AB. (2) expr substrExpr substr

Linux RMAN backup shell script

RMAN backup is easy to use for Oracle database backup and recovery, with low costs. For non-catalog mode, it is undoubtedly the first choice to embed the RMAN script into the shell script and then use crontab to back up small and medium databases.

Linux Shell programming notes

  #/Bin/bash 1, Wildcard *: Match any character or string, including an empty string. ? : Match any character. For example :?ABCCan match anyABCIt is a string of four characters that can be switched to or from any character. […]: Match any single

Usage of various quotation marks in Shell

Go to: http://goward.jimdo.com/2010/06/15/linux-shell%E5%90%84%E7%A7%8D%E5%BC%95%E5%8F%B7%E7%9A%84%E7%94%A8%E6%B3%95/ The difference between these characters is how they affect variables (such as $ name) and shell commands (such as date ). For any

Chgrp of shell commands

root@bt:~/test# chgrp --helpUsage: chgrp [OPTION]... GROUP FILE... or: chgrp [OPTION]... --reference=RFILE FILE...Change the group of each FILE to GROUP.With --reference, change the group of each FILE to that of RFILE. -c, --changes like

Common shell Variables

1. Embed shell Variables 1> cdpath: this variable retains some directory information, separated by the colon. If this variable is set, shell will first find the value saved in this variable when a directory is stored in CD; If the CD switch

Common shell commands for Linux

Some common shell commands in Linux For many programmers who often program in XP, it is not a habit to suddenly switch to programming in Linux, because a lot of things that can be done with the mouse in XP before, now we use commands to complete the

One pressure sink, renamed the ftp-uploaded Shell

# Ftp addressFtphost = "130.59.99.110"Username = "3weblogic1"Password = "3weblogic1" ./Exp_lanstop_remindGzip-F sig_conf_year.txtMdx = $ (csum sig_conf_year.txt.gz)# Echo $ mdxMD5 = 'echo "$ MDX" | awk-f''' {print $1 }''# Echo $ MD5Curdate = 'date +

Record split Shell

If [-z "$1"]; thenEcho "You did not enter the parameters for executing the shell"Exit;Fi If ["$1 "! = "JF"] & ["$1 "! = "Token"]; thenEcho "enter the name of the server to be uploaded: JF score, audit by region"Exit;FiCur_year = 'date + "% Y

General method for executing SQL in Shell

If you need to perform operations on the base database in shell, you can first create a corresponding function, as shown in figure Dbstr = "Tigger/pw123 @ orcl" Exesql (){Sqlplus-S $ dbstr Set autocommit off;$1;Commit;Exit;EOF} Phonelist = "1325

How to calculate the intersection and difference set of two files in Linux Shell

Assume that the two files file1 and file2 are represented by a and B. The content of file1 is as follows: A B C E d The content of file2 is as follows: C d A C There are basically two methods: one is the comm command and the other is the

Three types of shell script condition judgment (Memo)

String comparison: Result String1 = string2 string1 equals string2: True, otherwise false String1! = String2 string1 equals to string2: false, otherwise true -When n string is not equal to NULL: True, otherwise false -Z string when string is null:

Shell script notes

#! /Bin/sh# The first line is to tell the system who will execute this dumb. $ ## Number of parameters transferred to the script$ # ID of the current process during script running, often used as the suffix of temporary variables, such as haison. $$!

Total Pages: 541 1 .... 453 454 455 456 457 .... 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.