Case of shell syntax

The syntax format of case is as follows:Case VaR inExp-1) command body 1 ;;Exp-2) command body 2 ;;...*) Command body ;;Shell calculates the value of the variable VAR, and compares the result with the formula exp-1 and exp-2 until a matching formula

Run SQL in Linux Shell

Execute the SQL statement of the Oracle database in Shell #### Function #### Description: Execute an SQL statement ### input parameters: {SQL statement} {database TNS} {database user name} {Database User Password} #### output parameters: SQL

Share the powerful shell commands in daily work

1. display the top 10 processes that consume the most memory/cpu ps aux | sort-NK + 4 | tailps aux | sort-NK + 3 | tail ---------------------------------------- 2. view the number of concurrent Apache requests and their TCP connection status netstat-

"$ ()" In Linux Shell bash variable assignment

Reprinted: http://www.360doc.com/content/10/0303/16/155970_17438894.shtml Example 4-2. Simple variable assignment 1 #! /Bin/bash 2 # "naked" variable 3 4 Echo 5 6 # When is the variable "naked", such as when the front side is less than $? 7

Usage of details in shell test-n

  #! /Bin/bash # Add the hostnameRead-P "Please input your hostname:" hostname Old = 'cat/etc/sysconfig/Network | grep hostname | awk-F = '{print $2 }''Sed-I "s/$ old/$ Hostname/g"/etc/sysconfig/Network Echo "the/etc/sysconfig/network has changed,

Default variable of shell script ($0, $1 ...)

  Suppose I want to run a script with parameters. After running the script, the screen displays the following data: What is the program file name? How many parameters are there? If the number of parameters is smaller than 2, the user is notified

Notes on Linux Shell

1. query all files with no Suffix in the current directory: Find.-Type F-and! -Name "*.*" 2. query all files in the current folder that use the Windows Line Break (CRLF) and have no suffix. Use the-M parameter to convert them to Unix format (LF ).

Windows Power Shell

Http://baike.baidu.com/view/2838635.htm? Fromid = 58531 Windows Power shell ask for help editing encyclopedia business cards Windows Power Shell Windows powershell is a command line shell program and script environment that allows command line

Mathematical calculation of variables in Linux shell scripts

Let's start with an example: x=1+1echo $x Are you expecting output 2? Let you down. The output result is 1 + 1. Why? This is because the variable type in shell script is "string" by default, so if the variable type is not specified, 1 + 1 is a

Shell programming/[win/Linux] Other related records

1. Get the return value of Command Execution ? 2. Get the return value of Script Execution #!/bin/bashecho "A test."exit 0 Echo $ ?, Output: 0 3. Execute programs in the background in Linux In Windows, use the start command and specify the/B

[Shell] Time Parameter

Parameters:% H (expressed in-23 ).% I hour (expressed as 01-12 ).% K hour (expressed as 0-23 ).% L hour (expressed as 0-12 ).% M minutes (expressed in-59 ).% P am or PM.% R time (including hour, minute, and second, expressed in 12 hours AM/PM ).% S

Shell script learning: SED, grep, sort, and uniq must be carefully read"

This afternoon, I was busy writing a small script one afternoon. There were a lot of errors in the middle. I found the details about sort and uniq, and I found some minor mistakes in writing the script myself, programming is a strictly prohibited

Shell script programming: Linux automated logical volume creation script

Write a script to create and manage LV:Note: During script execution, a menu is displayed to the user, as shown in the following figure:A create an LV.B create an LV in an existing VG.C extend an LV.D reduce an LV. If you select item A, the

Shell script learning-9 (LN command learning)

[Starting text] Ln is a magic command. It can create a file shadow or enter another place through one channel. :) In fact, all these tricks are implemented through soft connections and hard connections. Let us assume that you have read the article

Set Font color in Shell

Color is selected by adding a special sequence --Basically"/E ["And"M"Between numeric values. If more than one numeric code is specified, separate them with semicolons.Echo-e "/E [31; 40 m" First digit (31)Foreground color(Red); The second digit is(4

Process command line parameters in shell scripts

Command line parameters when running the script, as shown in figure ./myscript.sh -a -b arg In scripts, case statements are usually used for processing. My personal favorite practice: first try to use long parameter names (short parameter names are

General shelling steps and example of encrypted Shell

Today, I am mainly going to have a deep understanding of the assembly language. If I want to decompile the language, this is not enough. Of course, this is not a day or two that can be successful. Continue to work hard.   I. How to distinguish the

Unix shell and if Parameters

Source Address: http://space.itpub.net/10687260/viewspace-293440 [-A file] true if the file exists.W (g3cu. T * mb7q6a0[-B file] If the file exists and is a special block file, it is true.S8ydayx 'gi0[-C file] If the file exists and is a special

Sorting out Classic shell interview questions

1. Retrieve the number of times the shell appears in the/etc/passwd file Problem: The following is part of a/etc/passwd file. Obtain the shell and count the number of times. Shell refers to the following/bin/bash,/sbin/nologin, for example, the

UNIX common system variables and shell command line parameters

UNIX System Variables$? The return code of the previous command or function.$ # Number of parameters$, $0 is the program body, from $1, $2, $3 is the parameter$ * String: saves all parameters in the form of "parameter 1 parameter 2 ..."$ @ String

Total Pages: 541 1 .... 506 507 508 509 510 .... 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.