The shell iterates through a sentence, outputting a specific long string

Take out a string of specific long strings in a seriesMethod One#!/bin/bashhello= "hello,world.my name is Jerry,what ' your name?" For word in ${hello[@]};d o [${#word}-GT 4] && echo $worddoneMethod Two[' Echo $word |wc-l '-GT 4] && echo $wordMethod

Linux system-shell Programming-several shell scripts

Linux System-shell programming-several shell scriptsone kill the userkilluser.sh#!/bin/sh# The script to kill login userUser_name= "$"/bin/ps aux | /bin/grep $user _name | /bin/awk ' {print $} ' >/tmp/temp.pidKill_id= ' Cat/tmp/temp.pid 'For PID in

Testing and content substitution for shell variables

Reference "Bird's private cuisine--linux Basic Study (third edition)".In "bird Brother's private cuisine--linux Basic Study (third edition)" in the 11th chapter, bird Brother about the variables of the test and the content of the replacement, the

Shell grep matches Kanji

Shell grep matches ChineseTest text demo_exe.c, content as follows, need to pay attention to the saved encoding format, the output to the terminal has an impact:Our Chinese operating system Asni by default is GBK.1#include 2#include 3#include string.

Getting Started with Shell scripting basics

Bash Script programmingOne, Bash script programmingBash script programming (can be understood as a stack of commands)Program: Contains statements and expressions (with judgments and loops)Sequential executionSelect ExecuteLoop executionprogram =

Open a post and start learning shell programming

Well, that's how it started.First of all, this little episode ... It was written, it collapsed, and then I collapsed ... Crash I looked everywhere for a tool that would not let me collapse, and then find out to find the ScribeFire.1. Take parameters

Shell Programming Examples

First, Introduction 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

Shell Common operations

1. Read the value of the Jdbc_url parameter in the configuration file ($InputParamFile the absolute path of the destination file to be read)Jdbc_url= ' grep ' Jdbc_url ' $InputParamFile | Awk-f ' = ' {print $} '2. Modify the value of the

Shell program Exercises

#!/bin/sh notifications are explained by bash. If you execute the shell command date in the Echo statement, you need to precede the date command with the symbol &;You cannot execute the file immediately after editing the file, and you need to set

Writing shell scripts and executing

This study: Understanding the shell, how to write shell scripts and executeThe shell is actually a program that interprets the execution of commands,The so-called shell programming is to use a certain syntax to combine the various basic commands,

Three. Shell Basics 2

I. User and user group management . Root User: The system is unique, is real, can log on the system, can be operating system any file and command, with the highest authority; 2.Virtual User: Distinguished from real users, such users do not have the

Linux Shell string interception and splicing

A string interception of Linux is useful. There are eight ways.Suppose there is a variable var=http://www.hao.com/123.htm1 # Intercept, delete the left character, and leave the right character.Echo ${var#*//}where Var is the variable name and the #

Shell Script Example

Shell Basics: http://bbs.chinaunix.net/forum.php?mod=viewthread&tid=452942First, cycle 1-100, and calculate the 1+2+3+4+5+6+7+8+9+10 and#!/bin/bashSum=0For ((i=1;iDoWhile [$i-le 10]Dosum=$ (($sum + $i))BreakDoneDoneEcho $sum#me: Notice the time1.sum=

Linux starts from the shell

1:shell Basics:Learning about Linux is known to have a shell concept, the shell is between the user and kernel, the user's operation or instruction through the shell interpretation passed to Kernel,kernel can understand and perform the corresponding

Shell cannot execute post-su script

Issue: After executing the "su– username" in the shell script, the script terminates execution and switches to the interactive interface behavior of the specified user name in su: I execute a script in root, but some of these commands or scripts

Apue Exercise 3.2 and the use of redirect symbols in the shell

The requirement of exercise 3.2 is to write a function with the same dup2 () function without using fcntl (). It is intuitive to constantly use the DUP () until the specified file descriptor is returned. #include #include #define OPEN_MAX 6

Shell Scripting Learning

1111111111111 simple command script to clear messages log file under/var/log/var/log/the log file when the system files, must have root permissions:$UID is the global variable of the system:Make && make install indicates that the previous success

Let the echo output in the shell script color

Http://www.linuxidc.com/Linux/2014-12/110463.htm#!/bin/bash#定义颜色的变量Red_color= ' \e[1;31m ' #红Green_color= ' \e[1;32m ' #绿Yelow_color= ' \e[1;33m ' #黄Blue_color= ' \e[1;34m ' #蓝pink= ' \e[1;35m ' #粉红res= ' \e[0m '#需要使用echo-EEcho-e

Linux Shell script introduction Reading Notes Chapter 1 test and test

Linux Shell script introduction Reading Notes Chapter 1 test and testI. Introduction 1. Bash (Bourne Again Shell), which is currently the default shell environment for most GNU/Linux systems. All commands are input and executed in the shell terminal.

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 .... 263 264 265 266 267 .... 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.