Shell Display-bash-4.1# Workaround

When operating on SECURECRT, do the following carelessly:?????????????????? [[email protected] ~]# echo "Alias rm= ' echo this command does '" ">. Bash_profile?????????????????? [[Email protected] ~] #source. bash_profile?????????????? When the

Daily shell exercise (--sed) processing

1. ExercisesFor a file, 1 to 5 lines delete the line with English, 6 to 10 lines delete the English characters inside;2. AnalysisThis requirement, with the SED command can be solved, mainly used to match the knowledge of replacement.3. Scripts#!/bin/

Deployment of the Shell

Shell's unfolding 2018-5-30? writen by Stephen.yu First, path name expansionBefore the shell executes the echo command, it automatically expands any qualifying characters on the command line, for example, * is expanded to the current path

Shell Programming (2)

1. (1) Change the main prompt to the user's home directory name (hint: reference material 4.6.8 section environment variable PS1 and HOME usage)(2) Assign the string DOS file c:>\ $student \* to the variable x and display it (hint: note the choice

Shell conditional expression

In shell programming, it is often necessary to determine the status of a file, whether the string is equal, and two numeric values, and then perform the related operations based on these comparisons. This paper mainly describes the file status,

Shell Script Forloops

1. Determine the type of all files in the/var/directoryfor files in /var/* ;do if [[ -f $files ]];then echo "$files exists and is a regular file." elif [[ -h $files ]] ;then echo "$files is a symbolic link." elif [[ -d

Common Shell usages

Analyzing Nginx Access Logsawk ' {a[b[$1]++]}end{for (I=length (a); i>0;i--) for (j in B) if (b[j]==i) {c++;if (c ' Www.dwhd.org_nginx.logThe effect is as followsSort statistics in reverse orderCat Access.log| Sort| Uniq -c| Sort 1 -n-rUniq only the

In the Shell | Usage

| The operator pipe symbol is a very powerful feature of UNIX, and the symbol is a vertical bar: "|".Usage: Command 1 | Command 2 His function is to pass the result of the first command 1 execution as input of the Command2 to command

Shell Foundation Combat

Learning Environment: Ubuntu  How to view the system version: [# Cat/proc/version]1. For loop Practice  1.1 batch generate random character file name caseExperimental purpose: Generate 10 randomly generated txt text under the/learning path, and the

Shell Programming--while Loops

Script[[email protected] shell]# vim while2.sh#!/bin/bashi=6while [ $i -gt 0 ]do i=$[$i-1] echo $idoneExecution results[[email protected] shell]# sh while2.sh543210Script[[email protected] shell]# vim while1.sh#!/bin/bashload=`w|head -1|awk -F

Daily Shell Exercises (04)

1. ExercisesDesign a script that monitors the surviving state of a remote host (assuming the IP address is 110.110.110.114) and sends a message to yourself when it finds an outage.Tips: You can use the ping command: ping -c 10 110.11

Shell Programming--if Statements

Format 1:if condition; Then statement; FiScript if1.sh[[email protected] shell]# vim if1.sh#/bin/basha=5if [ $a -gt 3 ] then echo okfiExecution results[[email protected] shell]# sh -x if1.sh+ a=5+ ‘[‘ 5 -gt 3 ‘]‘+ echo okokFormat 2:if

Shell Learning (iii)

1. Position variableScript:[Email protected] sh]# cat/opt/sh/test1.sh#/bin/bashecho "The script name and path you executed are:" $The first parameter of the echo "script is:" $The second parameter of the echo "script is:"The third parameter of the

Shell Entry Notes (i)

Shell IntroductionDuring the development process, the Linux system is frequently contacted and used, and the shell is a bridge for our users to use Linux, and is a program written in the C language. The shell is a command language, as well as a

Introduction to "shell" Linux shell functions

Linux Shell functions Write in front: function, this word in just the beginning of the classmate looks very tall, in fact, the shell inside the function is very simple, function is actually to reduce the amount of code, so this space may be

Use of shell special variables

$ Current PIN name$# the number of arguments passed to the scriptThe first parameter, and so on$*,[email protected] All parameters$$ Current Shell Process IDShell output shell name, PID, number of parametersList parameters in sequence#!/bin/bashecho"

Shell uses a small note

The shell is the preferred system administrator for its stability, efficiency and flexibility.1. Shell Introduction:Command line: Refers to the interface for the user to enter a command, which itself simply accepts input and then passes the command

Shell script cuts tomcat log files

Transferred from: http://www.cnblogs.com/lishun1005/p/6054816.htmlIn view of debugging Logback and log4j file cutting has not been successful, with the shell to write a script to cut Tomcat under the log file (everyone if you have in Logback or

Full-Library hot backup of shell scripts

#!/bin/bashbackup_dir=/oracle/backuplog_file= $ORACLE _base/admin/$ORACLE _sid/hold_backup_$oracle_sid.logecho   "Backuping cold backup"  > $log _filedata>> $log _filesqlplus -s /  As sysdba > $log _filealter database backup controlfile to   '

$0, $? In Shell scripts? , $! , $, $ *, $ #, $ @, Etc.

$0, $? In Shell scripts? , $! , $, $ *, $ #, $ @, Etc. $0 indicates the execution name of the program. The file name of the current script $ n indicates the nth parameter value of the program. n = 1 .. 9 $ * all parameters of this program. This

Total Pages: 541 1 .... 515 516 517 518 519 .... 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.