Shell string Truncation

Linux ShellTruncation character variableThe first 8 bits of the signature are as follows:1. expr substr "$ A" 1 82. Echo $ A | awk '{print substr (, 1, 8 )}'3. Echo $ A | cut-c1-84. Echo $5. expr $ :'/(.//).*'6. Echo $ A | dd BS = 1 COUNT = 8 2>/dev/

Common shell script Accumulation

1. Date Get time and date Date = 'date + % Y-% m-% d-% H' Echo $ {date}   2. cron Add a Task Scheduler # Vi/etc/crontab   Crontab task format * *** User task Minute hour, day, month, week, user task Field Description

How to Learn Linux Shell

Example about Linux Shell #! /Bin/bash echo "Hello world! " echo" Hello $ LOGNAME, it's nice talking to you " echo" U present working on a machine is 'uname-N' " echo" U Present working directory is $ (PWD) " echo" Bye for now $ LOGNAME. the time

Common shell string operations

1. String Truncation (1) intercept the string before and after a specified character [Root @ gd86 applications] # Var = Hello: zkl: zyh [Root @ gd86 applications] # echo $ {var %: *} returns the first string from right to left.Hello: zkl[Root @

Linux Shell Learning

Regular Expression $ Matches the end position of the input string. If the multiline attribute of the Regexp object is set, $ also matches '/N' or'/R '. To match the $ character, use/$. () Mark the start and end

Common commands and syntaxes for grep, awk, and sed in Shell

Common grep command syntax 1. Double quotation marks and single quotation marksWhen you input a string parameter in the g r e p command, it is best to enclose it with double quotation marks. For example, "m y s t r I n g ". There are two reasons for

Makefile and shell Problems

Anyone who knows makefile knows that makefile can call shell scripts. But in actual use, it is not that simple, and some ambiguity may make you crazy. If you don't believe it, let's take a look at several examples. Imagine what these examples will

Create an unzipped installation package in Shell

Create an unzipped installation package in Shell Principles In Linux, you can use several basic commands to create a self-extracting program. The principle is: The Cat command can be used to connect two files (with> append can achieve the same

Differences between logon shell and non-Logon Shell

By using the startup script, you can make the custom environment ready for use once and for all.These scripts run when the shell is created.The startup scripts run vary depending on whether the shell is used to log on to the shell or not.We use "Su-"

Windows 98 shell Language

  Windows 98ShellLanguage Yang shanhe   The Senior cfan from Dos crawlers knows that the batch processing language "batch" edits a batch processing file and can be executed in DOS immediately to complete tasks that do not require too much

Shell script set record

#!/bin/bashcat 1 | grep " 403 " | while read linedo index=`expr index "$line" GET` let startindex=$index+3 echo "startindex:"$startindex endindex=`expr index "$line" \?` echo "endindex:"$endindex if [ 0 -eq $

Linux Shell Learning

"Hello World" shell scriptBased on the traditional program teaching example, we will introduce how to write shell script "Hello World. -------------------------------------------------------------------------------- #! /Bin/sh# Filename: HelloEcho

Quick edit shell command line

Preface Quick edit shell command line The most common cause is that Nux beginners say that the most annoying thing is Linux/Unix command lines. If you are an impatient person, you can first try the comprehensive exercises at the end of the article

Shell programming (3)

Instance General programming steps Now let's discuss the general steps for writing a script. Any excellent script should have help and input parameters. And write a pseudo script (framework. sh) that contains the framework structure required by

Linux Bash Shell Learning (15th): variable type and integer calculation

This article is Chapter 6 of "Learning the bash Shell" 3rd Edition, Command-Line Options and Typed varilables, but we will not limit it to this. Previously, the variables we involved were basically strings and integers, for example, $ # Of the

Linux Bash Shell (17): I/O redirection

This article is one of the seventh chapter Input/Output and Command-Line Processing of Learning the bash Shell 3rd Edition. We have learned the basic IO redirection operations of shell:>, Cmd1|Cmd2: Pipe, SetCmd1Standard outputCmd2Standard

Call shell commands in pl/SQL

Use the dbms_pipe package and create a daemon running on the OS I think this method is complicated. I still need to use Pro * C. I didn't try it. Here is an example. Use Java's getruntime(cmd.exe C Java uses a lot of such advantages. 1) write a

Simple encapsulation of shell scripts for wget

Simple shell script encapsulation for wget Article: http://blog.csdn.net/5iasp/article/details/8862303 Author: javaboy2012Email: yanek@163.comQq: 1046011462     Purpose: capture a url and save it to a specified file in the specified directory.

Linux shell shortcut

From: http://blog.sina.com.cn/s/blog_7556be720100ryp2.html CTRL + P repeat the previous command CTRL + a jump to the first characterCTRL + x same as above, but once again, it will return to the original locationCTRL + B move one character forward

Shell automatically enters verification information

In Linux, It is very troublesome to use ruijie. After installing myxrgsu, you must enter your account and password every time you use it. This process is too cumbersome. So I want to find a way to automatically enter the password and other

Total Pages: 541 1 .... 387 388 389 390 391 .... 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.