Basics of Shell programming for Linux Learning notes

Programming languages: Machine language, assembly language, advanced languagesStatic language: Compiler language, features: strongly typed ( variables must be declared before they are used, or even initialized ), and converted to executables.

Loops in a shell script

The commonly used loops have a for loop and a while loop. For loop [email protected] sbin]# cat for.sh#! /bin/bashfor i in ' seq 1 5 '; Do Echo $idoneA sequence in the script that seq 1 5 represents from 1 to 5. You can run this

IFS and $* variables in the shell

This article is reproduced from http://blog.chinaunix.net/uid-22566367-id-381955.htmlSelf-documenting content. The shell script that encountered the relevant content in the project. Record in this placestring1="111 222 333 4444"echo $STRING 1echo"$

Shell Programming for loop Summary

Shell Programming for loop Summary In shell programming, the execution of a loop is repeated several times for a piece of code, a common loop has a for, while, and a until loop, where the for loop is often used for finite cycles, and the

Makefile How to use the shell if judge

/********************************************************************* * Makefile How to use shell if judgment * Description: * For example, it may be necessary to determine the existence of files, folders in Makfile, use shell syntax * To output

Shell command ls

Name: lsFeatures: View a list of files1[Email protected]6380-mt:~$ls2Add-on.yaml Desktop examples.desktop meta-gnome3-3.8+4UBUNTU3 PERL5 pycharm-2016.2.2 suVideos3Admin.conf docker-ce_17.03.1~ce-0~ubuntu-trusty_amd64.deb

Shell Scripting Exercises

The new handwriting of the shell, write bad, please forgive us.Hope to make some great gods and peers. qq:86416192 welcome everyone to add QQ.1, write a script, show how many users, and display the ID of each user.#!/bin/bashFile= "/etc/passwd"lines=

Linux Shell Basics

Shell Foundation: Shell is the user interface of the system, which provides an interface for users to interact with the kernel. It receives the command entered by the user and feeds it into the kernel to execute.  We followed the Shell's grammar

Shell Work Note 01

When you run the script, you need to change the color of the text to improve the readability of the standard output.The echo command and the printf command enable this functionality.Formatted output can be implemented using the printf command, which

Shell script (Batch create script)

While ;(create a 20 file )Cd/etc/servicesMkdir-p scriptsVim scirpts. Sh#!/bin/bashI= 1, dir=/scirptsWhile [$i-lt 21]Do Touch dir/test$iLet i = $i +1DoneBatch renaming:#!/bin/bashI= 1, dir=/scirptsWhile [$i-lt 21]Do MV dir/test $i alex$iLet i = $i

Shell script, insert "|" between every 5 characters, do not insert "|" At the end of the line

TextAaaaabbbbbcccccddddEeeeefffffkkkkkvvvvNnnnngggggThe results I hope to receive are as follows: AAAAA|BBBBB|CCCCC|DDDDEeeee|fffff|kkkkk|vvvvNnnnn|gggggMatch requirements: You want to insert a "|" between every 5 characters, and if the number of

Linux Shell script Programming--cut command

CutThe Cut command extracts text columns from a text file or text stream.Cut grammar[[email protected] ~]# cut-d ' The delimiter character '-f fields The PATH variable is as follows[Email protected] ~]# echo

Shell script recursively prints all folder files in the specified folder

#!/bin/bash#递归打印当前文件夹下的全部文件夹文件. PRINTF() {ls $| while ReadLine#一次读取每一行放到line变量中 Do[- D $/$line] && {dir="$/$line" Echo $DIR} dir1= ' DirName$DIR`#求路径. A= ' Ls-f$DIR 1| grep/| Grep"\$line\>"` #推断line是不是一个文件夹. if [ " $A " = = " $line /"]

Using the shell to automate script files under Linux

The following instance is used in the Centos6.5 64-bit operating systemOne, the regular copy fileA. Create the tomcatback.sh file in the/usr/local/wfjb_web_back directoryFile contents:#将tomcat中的应用wfjb_web copied to the/usr/local/wfjb_web_back/tomcat_

Linux Shell Script Programming learning notes and combat

Http://www.1987.name/141.htmlShell Basics Terminal printing , arithmetic operations , frequently used variables Search for a specific string under the specified folder and highlight matching keywords under Linux Get standard input from a

Shell script automatically adds black malicious attack IP

Shell script automatically adds black malicious attack IPSystem environment: Centos 6.5 X64If we open the SSH 22 port to all the users, then we can see in the/var/log/secure file, where the face is full of malicious attacks of IP, then how can we

Single quotation mark (') Double quotation mark (") and back quotation mark (·) in the shell

In bash, $, * 、?、 [,], ', ', ', \, have special meanings. Similar to the compiler's pre-compilation process, bash, in the process of scanning the command line, will first interpret all the special characters at the text level, and then make the

concurrency in shell scripts

The main record is the concurrency and serial execution of commands in the shell script.By default, the commands in the shell script are executed serially, and must wait until the previous command is finished before executing the next command, but

Shell file test, menu presentation idea

---restore content starts---File test expression-F file exists and is a normal file-D file exists and is a directory file-S file size is not 0 true-e file exists then true-R file is saved and readable #文件属性对于root有时不好用-W Write-X execution-L exists

Hadoop (ix)-hbase shell commands and Java interfaces

A. Shell command1. Enter the HBase command line./hbase Shell2. Display the list of tables in HBase3. Create a user table, including info, data two column familiesCreate ' user ', ' info ', ' data 'Create ' user ', {NAME = ' info ', VERSIONS = ' 3 '}4

Total Pages: 541 1 .... 163 164 165 166 167 .... 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.