Shell environment variables & parameter variables

Environment variables $HOME Home directory of the current user $PATH A colon-delimited list of directories to search for commands $PS 1 A command prompt, usually a $ character, but in bash,

[Shell base]--variable

Assigning values to variables#定义变量, note that there is no space on either side of the equal sign variable=#定义环境变量Export variable=#双引号: Can contain spaces, can escape special characters variable="" #$ () or anti-quote: assigns a command

Job Management in the shell

ReferenceHttp://www.cnblogs.com/ggjucheng/archive/2012/10/21/2733028.htmlAdd a & after the command, such as Firefox &: Background execution.Jobs-l command lists How many commands are currently running in the backgroundCTRL + Z or send signal 17:

Learn the shell bit by bit

1. Get the name of the shell script${BASH_SOURCE-$0}2. Get the path to the shell scriptDirName "${bash_source-$0}"This path is not necessarily the true path of the script, for example, assuming that the command is in

Linux timed execution shell

First step: Install crontab, command yum-y install Vixie-cronExtension: Service Crond start//Startup servicesService Crond stop//Shutdown servicesService Crond restart//Restart servicesService Crond Reload//Reload ConfigurationService Crond

Shell syntax in makefile

Writing shell code in makefile is a bit weird, unlike shell syntax, and if you don't understand it, it can be confusing to see makefile. Here's a summary of some.1: The code that is the same line after the colon of the target item of the makefile

Talk about the background process and foreground process of shell in Linux

Environment:Operating system: ArchLinux; Terminal Simulator: Rxvt-unicode (URXVT); Shell:bash;The background process referred to here is a ampersand (&) behind the command line, and the foreground process is the form of a command line that does not

How the shell intercepts strings

Summary of Shell interception string methods in LinuxHow does [Linux] calculate string lengths in shell scripts?There are eight ways to intercept a string, mainly for the following methodsThere are a number of ways to intercept strings in the shell,

Shell Script--Guess number

#!/bin/bash#It ' s written by Caibingsen#Date: 2016-03-15# # Function: Guess the number in the 0-9 range# # Requirements: 1, automatically generate a number each time# # 2, guess wrong five times auto exit# 3, guess the automatic exit# # 4, input

Shell programming text and log filtering

1:grep Command:Grep-v "char" file_name matches text that does not include "char"Grep-n-W "char" file_name complete match for a charactergrep ^s $s are text that matches the beginning of s or the end of the line as S.2:TR commandTR Set1 Set2 Replace

Linux Shell Notes

Cat  /etc/passwd   All system user accounts list and basic information for each user cat/etc/meminfo the current state of the virtual memory ipcs-m   View the Shared memory page on the current system  [[email  protected]~] #当前shell的用户名, current

Tomcat Maven shell script saves time and effort

Modify the Tomcat Server.xml to unpackwars= "false", and then Maven generates a. War with two functions:1 No manual decompression required. War (Tomcat is not automatically decompressed if there is a folder with the same name and a war with the same

1.1 Shell Features

#shell特性| Pipeline> Redirection>> Chasing heavier orientation2> Error Redirection2>> Append Error redirection#作业控制CTRL + Z to temporarily stop the jobJobs View JobFG recalled to front desk+ Higher PriorityFG 2 designated number recallBG tuned to

Shell Exercise 1

Write a script: The requirements are as follows:1: Say hello to each user in the/etc/passwd directory, and indicate its UID number! (Eg:hello Root,your uid is 0)2: How many accounts does this script share?#!/bin/bashName= ' cat/etc/passwd |awk-f: ' {

Linux Shell Special variables

$: script name, which is the script name entered by the command line$n: Positional parameters, n>0, when n>9, using ${n} form$#: Number of positional parameters"$*": All Positional parameters (single string)[Email protected]: All positional

Shell Statistics Log Information

Shell Statistics Log InformationIn general applications, log information is logged using log4j and a log file is generated daily, with each file ending on the date of the day.How do I count and analyze these log messages?In the simplest cases, use

Shell Primer-awk-1

The advantage of awk for sed grep is segmentation, dividing the delimiter into a small segment, matching, replacing, manipulating, logical judging, comparing ... such asBasic operations of AWK[[email protected] ~]# awk-f ': ' {print $} ' 1.txt////-F

Shell Time Statistics Script

#!/bin/Sh#today= ' Date +%y%m%d ' year= ' echo $ '1|cut-c1-4' MONTH= ' echo $ '1|cut-c5-6' Day= ' echo $ '1|cut-c7-8' time= $YEAR-$MONTH-$DAY #echo ' Date-D"$TIME-2 Day"+%y-%m-%d ' URL="/home/work/webdata/logs/focusapi_access_log.$1"#昨天的日期 #yes_dt= '

JS Implementation Shell Sort

//shell sort with insert sortfunctionShell_insert_sort (arr) {varGap =arr.length; Do{Gap= parseint (GAP/3) + 1;Console.log (GAP); for(vari = gap; i Gap) { varTMP =Arr[i]; for(varj = I-gap; J >= 0 && tmp Gap) {Arr[j+ Gap] =Arr[j]; } arr[

Django Shell Create, remove, sort print

models.pyFrom django.db import modelsclass person (models. Model): Name=models. Charfield (max_length=30) age=models. Integerfield () def __unicode__ (self): return self.name./manage.py ShellPerson.objects.order_by ("id")[, , , , ,

Total Pages: 541 1 .... 523 524 525 526 527 .... 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.