Replacement in the shell

If there are some special characters in the shell, you need to replace them, you can do command substitution, variable substitution, escape substitution1. Substitution of escape charactersThe shell contains the following transfer characters\a Bell

Getting Started with Linux shell programming

From the programmer's point of view, the shell itself is a program written in C language, from the user's point of view, the shell is the user and the Linux operating system communication Bridge. The user can either enter command execution or use

Explanation of the meaning of "2>&1″" in the Linux shell script

The script is: nohup/mnt/nand3/h2000g  >/dev/null  2>&1 &  for & 1 more accurately said file descriptor 1, and 1 The general Representative is Stdout_fileno, which is actually a dup2 (2) call. He outputs the standard output to All_result, and then

If in the shell compare

The way to compare two strings for equality is:If ["$test" x = "Test" x]; ThenHere are a few key points:1 using a single equals sign2 Note that there is a space on each side of the equal sign: This is the UNIX shell requirement3 Notice the last X of

Bash Shell Basic Operation commands and environment variable commands (note)

First, the Bash Shell Basic Operations Command 1.type: See if the command is a built-in command of the Bash shell type cd2.Echo: The display of the variable echo $ variable echo name3.unset: Cancels the variable you just set unset name4.Envor SET

Shell scripts delete folders that are N days ago-----Different from the date command on Linux and Mac

Background:The items that are built daily are placed in different folders by date. As today's construction is put into 2015-06-01, tomorrow's will be put into 2015-06-02, and so on. Long time, need a script to delete the folder N days ago. (In this

Shell (BASH) programming

SHELL programmingDirectory:1.shell Brief Introduction2.shell Programming Preparation3.shell Programming Structured Language Building4. OtherTwo examples of 5.shell programmingWrite in front:1.Hello World#! /bin/bash# This is aexample of bash

The shell script function determines whether the IP address entered conforms to the rule

#判断IP是否符合标准规则function  judge_ip () {         #这里local  $1 error, with 2 >/dev/null Shield off error, no effect on the output results         local $1 2>/dev/null         TMP_TXT=/tmp/iptmp.txt         echo $1 > ${tmp_txt}        ipaddr= ' grep  -Eo 

Shell Programming---condition judgment

I. Condition judgment of shell programming1. Integer testA. Expressions for conditional tests[Expression][[Expression]]Test expressionB. Integer comparison-EQ: Tests whether two integers are equal, such as $A-eq $B-ne: Test whether the two integers

Linux shell Script (ii)

Five, string processing1. Sub-string interception operations:Path segmentation:DirName command: Locate the folder where the target is locatedbasename command: The name of the target object, usually refers to the file name or the lowest-level

[Shell]bad substitution

There was a bug when I wrote a shell script recently#!/bin/shRight=disk1PART=${RIGHT//[A-ZA-Z]}Tips:Bad substitutionAt the command-line input, it is running correctly.Checked the next someone said to change SH to bash, found the problem solved.

Ubuntu System Write shell script program installs multiple packages at once

Ubuntu System Write shell script program installs multiple packages at onceWriting shell scripts installs multiple software at once, primarily for some software-dependent environment configurations.1. The shell script must start with the following

The small symbol reflects the big problem, the shell underline _ and the variable relationship.

I've written before. A problem was encountered when naming filenames automatically by date and time.#! /bin/"Pleaseinput the filename:" filenamedate3'2 days ago ' +%y%m%/home//home/$filename'_'/ home/"$filename _$date3"Output is three files23:22 20

Linux CentOS under the shell display-bash-4.1$ does not display the user name and host name of the workaround

New CentOS Add a user, log in to find that the shell script information does not display the user name and host name, but instead shows the-bash-4.1$, instead of the [email protected]$ combination that we often see, looks particularly uncomfortable. 

Solve problems with the shell and Mongoshell!

Fix the problem: convert GMT to Beijing time via JS script and push it to the demand side.# time converted to pure digitalStarttime= ' date-d '-1 day "" +%y-%m-%d 00:00:00 "Endtime= ' Date ' +%y-%m-%d 00:00:00 "'st=$ (' Date--date ' $startTime ' + '%

Linux Bash Shell string extraction, merge by column, and formatted output

Source of demand: The default IP link show command output will output the network card (including the virtual network card) name, MAC address, port status, and other information, but also mixed with some useless information, this time the string

Shell symbol expansion

Character expansion*This "*" character means matching any character in the file nameThe shell expands "*" into something else, before the echo command is executed.~ Home DirectoryArithmetic expression expansionAn arithmetic expression expands using

Shell Basics (RPM)

Shell Foundation 1: File Security and PermissionsHttp://bbs.chinaunix.net/forum/viewtopic.php?t=434579&highlight=winggerAttached: Linux user and user group managementHttp://bbs.chinaunix.net/forum/viewtopic.php?t=438660&highlight=winggerShell Basics

Some of the special symbols and functions that are common in shell scripts

This article mainly introduces some special symbols and its function in shell script, summary is very concise, easy to understand, the need for friends can refer to the next In writing shell scripts, we need to use a variety of special symbols,

Password Change in non-interactive mode in Shell scripts

Password Change in non-interactive mode in Shell scriptsToday, when I wrote a shell script, I found that the user's password needs to be set and the password is set to interactive. This is obviously not good in the script, So I went online to search

Total Pages: 541 1 .... 168 169 170 171 172 .... 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.