Linux shell structure with source command

Linux shell& Environment variableswhen you log on to the system, a user shell is started. In this shell, you can use a shell command or declare a variable, or you can create and run a shell script program. When you run a shell script, the system

Learn Shell script Diary

linux,shell2015-02-07    1. Scheduled tasks: Corntab-e writing Scheduled Tasks     CORNTAB-L viewing Scheduled tasks       Corntab-r Clear all Scheduled Tasks            If you want to clear a scheduled task, you can go to the edit page of the

The meaning of special variables in the shell

Linux shell $$, $#, #!, $*, $, [email protected], $-, $0~$9 meaning$$Shell itself PID (process ID)#*All parameter lists. such as "$*" in the Case of "" ", in the form of" $ $ ... $n "output all parameters.[Email protected]All parameter lists. such

Split string in Shell

Recently the system has learned shell programming.See an example in the book, very dick. I thought about it before, but I didn't get the result.I believe that the students also guessed this example, is a line of string splitting. Students can try it

Shell traverses each line of the file

Because the use for to read in the file line, will automatically put the space and newline characters as the same delimiter, because when there are spaces in the line, the output will be very messy, so ...Cat Input.txt |while Read line> Do> Echo

Shell Learning Notes (i)

1.1) Integer calculation:(1)$ (()): for mathematical calculationsecho $ ((3+3))(2)Expr: There must be spaces on either side of the operator, if $[] is included, you do not have to consider whitespace issuesExpr 2 + 22) floating point calculation:BC

Settings for Shell script colors

echo display in script with color display, echo display with color, need to use parameter-EThe format is as follows: Echo-e "\033[word background color; text color m string \033[0m"For example: Echo-e "\033[41;36m something here \033[0m" where 41 of

Shell determines whether the input is valid IP and letter

Tag: Shell Determines whether the input is valid IP shell determines whether the input is a letter1. Purpose of demandRecently in the study of ansible automation tools, in the host table (/etc/ansible/hosts) Add Management node information, a few to

Shell theory Learning (I.)

Login Host: Native Login (7 interface Tty1~tty7) Text Interface (TTY1~TTY6) Graphical Interface (TTY7) Telnet wildcard characters: *: Represents an arbitrary string, which can be an empty string

Syntax knowledge of shell scripts--Process Control

①if-elif-elif-else-fiIf-fi' if ($a >); then echo $a; fi ' or ' if [$a-gt];then echo $a; Fi 'If-else-fi' if ($a =), then echo $a; else echo 30;fi ' or ' if [$a-eq];then echo $a; else echo 30;fi 'If-elif-elif-else-fi' if ($a >) && (($a =)); then echo $

Automatically clears the Date directory shell script

Many times backups usually use a date-based folder to create folders, and for these date folders There are a lot of subfolders, and for these date files are removed all the time, it is a bit of a struggle to combine RM or delete with find. This

Linux timed execution shell script _crontab

1. View tasks [[email protected] oraclebacka]$ crontab-l2. New task [[email protected] oraclebacka]$ CRONTAB-E3, 14 points per day 40 execute/backup/oraclebacka/sh.sh script, log output to/backup/oraclebacka/shlog.txt* * * */backup/oraclebacka/sh.sh

Summary of Shell interception string methods in Linux

There are eight ways to intercept a string, mainly for the following methodsThere are a number of ways to intercept strings in the shell, ${expression} There are 9 ways to use them.

Common log statistics methods in the Shell

Before I published "Hadoop, kill chicken with sledgehammer, Python+shell to achieve the general log file query, statistics , "theneed to combine python, there may be a certain threshold, now the shell part stripping out. For example, some of the

Modify Shell terminal prompt information

The shell terminal only displays the user name, hostname, working directory by default, and sometimes we need to simply tweak the information displayed on the shell terminal to make the work more efficient. For example, we can add time to the shell

Common shell commands

1. SearchGREP-LR YHB./Indicates that all files in the current directory, including sub-files, are searched for the YHB character, and the file name is printed. If there is no-l, the searched rows will be printed out.2. Display the number of rowsNL

The shell logic of Linux

When the shell executes a command, it returns a return value that is saved in the shell variable $? In When $? = = 0 o'clock, indicating successful execution; = = 1 o'clock, which indicates that the execution failed.' | | 'Left command returns FALSE,

Syntax knowledge for shell Scripts 3

① managing LinuxW View the current system load/proc/cpuinfo Saving server CPU related informationGrep-c ' processor '/proc/cpuinfo Compute server CPU CountVmstats Monitoring System StatusTop Displays the system resources that the process occupiesSAR

Post a shell code

Long time no shell, hehe#!/usr/bin/EnvBashcounter=1 while[$COUNTER-lt + ]; DoEchoThe counter is $COUNTERCat>Tmp.sqlinsert into"Wcdata"VALUES ('' (printf "%03d" $COUNTER) '','0.00','0.00','0.00183','85.47943','4773267.7216','-10669.18'); EOFEchoThe

Linux shell reads files by row,

Linux shell reads files by row,One way is to use cat and reverse quotation marks. Ps: reverse quotation marks play the role of command replacement in Linux. Command replacement means that shell can insert the standard output of a command to any

Total Pages: 541 1 .... 481 482 483 484 485 .... 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.