Shell Learning Notes VI (Test and judgment)

Test and judgment tests use the $ after command execution to determine if the command is performing properly. $?==0? Normal: Error test structure: 1, test expression 2, [expression] #注意表达式两侧的空格 mode 2 increases the readability of the code, and more

Shell Learning Notes

#!/bin/bash# Author:undoner# Copyright (c) undoner# Test Code# -----------------------------------------------------------------#标准输入输出echo "What's your name?"Read personecho "Hello,${person}"printf "%d%s\n" 1 "ABC"# ---------------------------------

Linux Series-shell Learning notes

First record1, the simple HelloWorld writingInput command under Shell input:VI helloworld.shThen enter the text editor:#!/bin/shell#this is Ahelloworld testa= "HelloWorld" echo $aExecute helloworld.sh FileCommand:# sh helloworld.sh2, the variable

Shell changes file or directory names in bulk

To change file names in bulk:1. Add. bak or other regular characters after multiple filesLS |xargs-n1-i{} mv {} {}.bakOrFind./*.txt-exec mv {} {}_bak \;2. General-Purpose Batch change scripts#!/bin/bashread -p  "old extension:"  oldextread  -p  "new 

Some of the shell commands that you use

"System common Commands"passwd [hostname] Change PasswordUSERADD [hostname] adding usersSu- switch to root userSSH [hostname] SSH connectioncd [directory] into the directory directorysudo chown [username] assigns appropriate permissions

You may not know the shell

The shell is also called the command line interface, which is the interface between the user and the computer under the *nix operating system. The word shell refers to the program in the operating system that provides access to the kernel

Learn about the--bash Shell summary of Linux with the bird brother

Bash is a Linux-based shell, and many of the commands described in the front are handled by Bash's environment. Here's a general-to-local understanding of bash. For bash I've roughly divided it into three parts: variables, the configuration of the

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

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.

Linux issue: Crontab a problem with relative paths when executing shell scripts, not recognized.

Problem Description: The direct execution shell script in Linux can find the file with a relative path, but if you execute the shell script through the scheduled task crontab, you cannot find the file by relative path!Example:Shell script file Code ~

Note--shell Scripting Learning Guide

Shell Scripting Study Guide Mechanical industry publishing ISBN 987-7-111-25504-82nd Chapter2.4Primary traps1. Today's systems, for #! The length limit for this line is from 63 to 1024 characters, try not to exceed 64 characters.2. On some systems,

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

Installing the LNMP environment with shell scripts

#/bin/bash#----------------------------------------------------------------#data =2015-03-19#auth: Tongcheng#Nginx version:1.6.2#Php: 5.4#Mysql: 5.5.0#-----------------------------------------------------------------#删除关于安装软件的包Delete ()

Three ways to execute shell scripts

1. Bash script or SH script2,./script3,. Script or source script650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/5B/6C/wKiom1UIOtqyKgSsAADRgwmwoFU423.jpg "title=" QQ picture 20150317223121.jpg "alt=" Wkiom1uiotqykgssaadrgwmwofu423.jpg

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

Shell's basic concepts and variable types

Static languages: Compiled languages are converted into executable formats in advanceStrongly typed (variable)Key words:C C + + JAVA C #Dynamic language: Interpreted language on the flyWeak typeEdge Interpretation Side ExecutionASP. NET Shell PHP

"How to invoke a Java process using a shell script"

How to invoke a Java process using a shell script and look directly at the script:650) this.width=650; "id=" image_operate_42341429521334142 "name=" image_operate_25201429521283714 "src="/HTTP/ s4.sinaimg.cn/mw690/001wpbclgy6re3ma1lt83&690 "width=" 6

The meaning of the GitHub for Windows built-in Git Shell colors

In the process of using the command-line version, the Git Shell is often used in this very elegant git version of the control environment, he uses Windows PowerShell as the core, the message display and input support Unicode, compared to the Chinese

Test and content replacement of shell variables, replacement of shell Variables

Test and content replacement of shell variables, replacement of shell Variables Reference: laruence's private house dish-Linux BASICS (Third edition). In Chapter 11th of the Linux BASICS (Third edition, the final example illustrates '-', '=', and '

Use shell for mathematical operations and shell mathematical operations

Use shell for mathematical operations and shell mathematical operations Availablelet,(()),[]Basic arithmetic operations, advanced operationsbcMore efficient. Let's look at the code and make the output clear.Let [Zhengweiwu ~] $ No1 = 4 [zhengweiwu ~

Total Pages: 541 1 .... 300 301 302 303 304 .... 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.