Linux Shell intercepts strings

Linux Shell intercepts strings There are many ways to intercept strings in the shell${var#*/}${var##*/}${var%/*}${var%%/*}${var:start:len}${var:start}${var:0-start : Len}${var:0-start} Here are a few examples to illustrate:1) Get the

Linux Shell Learning Note 00

1. Bash = Bourne Again SHell2. Terminal prompt:#普通用户 [email protected]$ #管理员用户 [email protected]#3. The shell script is usually a text file that starts with Shebang:#! /bin/bashShebang is a line of text where #! is before the interpreter path.

Shell Note 7

Variable, which provides a way for users to store, retrieve and manipulate data. Environment variables, positional variables, predefined special variables, user-defined variables Environment variables(1) Shell environment variables, is a class

The understanding of shell and kernel

The Shell's English interpretation is the shell, echoing with the kernel kernel noun, one outside, one shell and one core. The kernel is like the Bank of Switzerland's treasury, storing the customer's gold and many other (hardware) assets,

Common variables, end states, and test expressions under the shell in POSIX

In the open-source Unix system usually for the convenience of management will be a lot of use of shell script, and in peacetime writing script when the fast and effective is a lot of built-in variables can be used, here is a simple summary of the

Execution of shell scripts and files

1. Shell Script ProgramThe shell is the "shell" of the operating system, and the shell provides users with a human-computer interface. All the user's actions on the computer and the data that the computer obtains are managed by the shell.Shell

Hadoop (v): Shell command

HDFs DFS -cat URI: Viewing the contents of a file HDFs dfs-cat HDFs Dfs-cat hdfs://mycluster/user/root/rcc1 HDFs dfs-cat file:///usr/hdp/2.4.2.0-258/hadoop/bin/RCC -ls : Check

Shell condition judgment

1. string Judgments STR1 = str2 True when two strings have the same content, length Str1! = str2 True when strings str1 and str2 are unequal -N str1 True when the length of a string is

Use of shell variables

Reprint please indicate http://www.cnblogs.com/winifred-tang94/There are three types of variables in the shell environment:A, environment variables; You can refer directly to the shell script in the form of "environment variable name".b,

Shell Script Loop statement--select loop

Select loopMainly used to create menus, the menu items arranged numerically are displayed on the standard output, and the PS3 indicator is displayed, waiting for the user to enter a number from the user input menu list, execute the corresponding

Shell Scripting Learning-Grammar Chapter

I. Condition testing: Test [The command test or [can test whether a condition is true, if the test result is real, the exit status of the command is 0, if the test result is false, the exit status of the command is 1 (note the exact opposite of the

Shell Scripting Learning Summary--file descriptors and redirects

The file descriptor is an integer associated with the input and output of the file, which is used to track open files, and the file descriptor 0,1,2 is reserved by the system.0--stdin (standard input)1--stdout (standard output)2--stderr (standard

shell--parameter passing

In the shell, arguments can be passed to a function when it is called. Inside the function body, the value of the parameter is obtained in the form of a $n, for example, "$" for the first argument, and $ for the second

Function of Shell programming

Functions: functionProgram programming: Code reuse;Modular programming;Structured programming;Consider the code of an independent function as a whole, and take a name for it; a named code snippet, which is a function;Definition and use of

Bash Shell terminal character color display

The character color of terminal is controlled by escape sequence, it is the system display function in text mode, and the specific language is independent, Shell,python,perl and so on can be called.The escape sequence starts with the ESC and can do

Linux Learning notes more bash shell commands

A monitoring procedure1.psOutput a lot of information about all programs running on the systemRunning the PS command will also open a processBy default, the PS command displays only the processes that are part of the current user running under the

Shell character (string) processing command

1.find find files that match your search criteriaFind Pathname-options [-print-exec-ok ...]--options:-perm: File lookup permission, plus number-type: File type, plus f: File D: Directory L: Symbolic link file-group: Find files belonging to group

Script Programming--shell

One, Shell scriptPre-placed in a file with a variety of commands to facilitate one-time execution of a program text; some shell syntax and instructions are written inside, and then the functions such as formal notation, pipeline commands, and data

Basic procedural exercises under the shell

1. Simple progress bar Program650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M02/82/F2/wKiom1dmiCfizPKcAABUqdm5Mxw224.png-wh_500x0-wm_3 -wmp_4-s_2159390602.png "title=" bar. png "alt=" wkiom1dmicfizpkcaabuqdm5mxw224.png-wh_50 "/>Lable array

Shell Backup Directory Script

#需求Write a backup script that backs up Samba files for 20 days#!/bin/bashdir= "/samba/operations" backup= "/data" filename= "operations.tar.bzip2" date= ' Date +%y%m%d ' [!-e "$dir"] && echo "Please contact admin" && exit[!-e "$backup" && mkdir

Total Pages: 541 1 .... 269 270 271 272 273 .... 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.