Shell parameter Introduction

$0 = Shell Name or shell script name $1 = first shell parameter ... $9 = ninth shell parameter $ # = Number of location parameters "$ *" = "$1 $2 $3 $4 .. $ N" "$ @" = "$1" "$2" "$3" "$4"... "$ N" $? = Exit status of the recently executed command $ =

Function inheritance in Shell

we know that variables are inherited by quilt processes, it can be used directly. In some cases, you may need to inherit functions to facilitate transparent use. The method is very simple. Use "Export-F". Pay attention to the parameter "-F", which

Erlang shell debug debugging

Reprinted: http://langzhe.iteye.com/blog/671762     Prerequisites: the Erl file must be compiled using the debug_info option. Otherwise, the invalid beam file or no abstract code will appear:Error Compilation Method: Make: All ([debug_info]). |C

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

Cross-compilation in LTP testing, such as the screen shell command

I recently tested LTP. I felt that there were too few materials on hand. I searched the internet and said that I had to look at the code from the beginning, because I had to look at the links in the past, there are too many test cases, so it is no

Shell note01: some shell combinations

Some shell combinations CTRL + L: Clear the screen CTRL + W: delete the word starting at cursorCTRL + u: Clear the line I. e. Delete the all words from Command LineTab: auto-complete files, directory, command names and much moreCTRL + R: search

"$ ()" 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

The longest shell command written by myself (haha)

Rm result.txt; grep "act = dataafter000000000482" raw_data_201%25.log | grep-V "; OK" | grep-V "404 \. H "| awk-F"; "'{split ($3, myarray ,","); print myarray [1] "#" myarray [2] "#" myarray [3] "#" $0 ;} '| awk-F "#"' {If ($1> = 5) | ($2> = 5)

Shell condition judgment Summary

-B file: if the file exists and is a special block file, it is true.-C file: if the file exists and is a special character file, it is true.-D file: if the file exists and is a directory, it is true.-E file: true if the file exists-F file: if the

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,

A script for Tomcat to create an instance (shell script)

  #! /Bin/bash Tc_home =/opt/Oracle/tomcat/ InstanceName = $1 [created instance]   CD...>/dev/null Template_dir = 'pwd' Echo $ template_dir If [! -D $ tc_home]; then Mkdir-p $ tc_home [Create if the directory does not exist] Fi   Usemethod

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 scripts syntax

Shell scripts are similar to the C language and also have a fixed language format. in short, shell scripts are like batch processing files (. BAT), the most basic function is to write a lot of commands together, so that users can easily execute a

[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] script task 7.18-7.21

Write a script:1. Create a directory/tmp/scripts2. Switch the working directory to this directory.3. Copy the/etc/PAM. d directory to the current directory and run the test command again.4. Change the owner of test and its files and subdirectories

Shell script learning-7 (SED command learning)

Example 5 insert some content after some strings [Rocrocket @ rocrocket programming] $ cat mysed.txtBeijingLondon [rocrocket @ rocrocket programming] $ SED's/B. */& 2008/'mysed.txtBeijing2008London The purpose of this command is to add the following

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

Shell script learning Summary

1. system environment variables after the user logs on to the system:$ Home user's own directory$ Path: the directory to be searched during Command Execution$ TZ Time Zone$ Mailcheck the number of seconds to check whether a new letter exists$ PS1

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

Total Pages: 541 1 .... 496 497 498 499 500 .... 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.