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

Several methods and differences for running shell scripts

#1 Add the execution permission chmod U + x a to the script. sh, and then you can directly use the full path to execute the script, for example, in the current folder. /. sh. If the directory where the script is located is in the path environment

Use BC in shell to compare decimals or Integers

  Echo listobjects = $ listobjectsecho logfile =$ {logfile} dos2unix $ {performancelog} &>/dev/Zero # Get the performancelog row number trac_rows = 'sed-n' $ = '$ {performancelog} '# echo trac_rows = $ trac_rowsi = 1 while [[$ I-Le $ trac_rows]; do

Difference between getopt and getopts in shell scripts

Getop string1 string2 .. the characters marked in nstring1 indicate valid signs (-can be followed by characters). If there are: After the flag, it indicates that this sign is followed (there can be 0-N spaces) stringx is its parameter. getop

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

Shell experience-usage of Variables

1. variable order In the script, there is no global or local variable for the same process. It is just a break. If you use a variable in a function, and there is no trace of this variable outside the function. However, as long as you have called

Judgment expressions for Linux shell commands such as-D,-F, and-e

Source: http://zhidao.baidu.com/question/322131711.html   File comparison operator-E filename if filename exists, it is true [-E/var/log/syslog]-D filename if filename is a directory, it is true [-D/tmp/mydir]-F filename if filename is a regular

Linux Automatic startup shell and init Overview

Linux running levelAfter Linux is started, it runs at one level. The following lists the running levels:0 system stopped1 single user system, no login required2 multi-user system, but does not support NFS, command line mode Login3 full multi-user

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/Unix shell automatic FTP backup file

Using shell scripts to monitor and manage Oracle databases will greatly simplify DBA workload, such as common instance monitoring, monitoring, and alarm log monitoring, and database backup, AWR report automatic mail, etc. This article describes how

Linux/Unix shell automatically sends AWR report

Observe the Oracle database performance. The AWR feature provided by Oracle provides us with a nearly perfect solution. With AWR features, we can extract AWR reports from the database at any time. However, we need to provide some interactive

Passing variables between Linux/Unix shell SQL statements

The flexible combination of Linux/Unix shell and SQL variable transmission greatly improves DBA efficiency, this article provides a few simple examples of passing variables between Linux/Unix shell SQL statements for your reference. Call SQL in

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.

How to use the. htaccess shell attack

Http://itsecuritylab.eu/index.php/2010/07/05/hide-shell-in-a-target-system/   It seems that you like shell very much. It's cute and happy. Next we will introduce a method to hide shell. htaccess attack. This must be an Apache server. Click it to

Shell conditional expression

F statement format If conditionThenCommandElseCommandFi, don't forget the end. If statements forget the final fiTest. sh: line 14: syntax error: unexpected end of fi Three conditional expressions of if

After Onda v811 is upgraded to 4.22d, the shell can use the root permission to control the file system.

After Onda v811 was upgraded to 4.22d, it was successful to use the master to root the machine. Baidu root is a floating cloud. It's worse than the flash master of a small company in Shenzhen! After root, log on to shell or shell @..., not root @...

Total Pages: 541 1 .... 425 426 427 428 429 .... 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.