Linux system-shell Programming-Basic Debug execution

Linux System-shell Programming-Basic Debug Executiona shell structure1 #! Shell that executes the script2 # Comment Line the annotation of the shell script is important and indispensable3 command and control structuretwo steps to create a shell

Marco Learning notes--shell variable types

Shell Variable BasicsThe shell variable is a very "weak" variable, by default a variable holds a string, and the shell does not care what the string means. So for mathematical operations, you must use some commands such as let, declare, expr, double

[Shell]bad substitution

There was a bug when I wrote a shell script recently#!/bin/shRight=disk1PART=${RIGHT//[A-ZA-Z]}Tips:Bad substitutionAt the command-line input, it is running correctly.Checked the next someone said to change SH to bash, found the problem solved.

Shell Common Command Collection

Grep-I ignores case-I skipping binary files-C Calculated Quantity-N Display Line number-R recursion-V does not match a keywordCommon combination CommandsGrep-iirn keyword * Search for files containing this keyword (n displays line numbers, I ignores

Shell learning-Getting started with awk

I. AWK application ScenarioFormat data or extract records from a large text fileTwo. How to use Command line mode$awk [-F field-separator] ' commands ' input-file (s)Commands is the real awk command.The [-F domain delimiter] is optional, and if

The Linux Shell "requires an integer expression here"

#! /bin/bashclearfunction verify{ If [$1-eq "Bob"] && [$2-eq "555"] then echo "verified" else echo "rejected" fi}verify Bob 555Run-time occurrence (integer expression required here) errorThe reason is a small error:"-eq" to compare

Variables and shell programming

Programming Ability:Script programmingProgramming languages: Machine language, assembly language, advanced languagesAdvanced Language:Static language: Compiled languageNo additional binaries are required, and a compiler is required to directly

memcached Start the shell script

#!/bin/sh## memcached:memcached Daemon## Chkconfig:-90 25# description:memcached Daemon## Source function library.. /etc/rc.d/init.d/functions. /etc/sysconfig/network#[${networking} = "No"] && exit 0#[-r/etc/sysconfig/dund] | | Exit 0#.

Small count (Restricted shell)

If we need to restrict a Linux user to use only the commands we specify, we can use the restricted shell.Use in a normal command environment:Test: # bash-r # Enter the restricted shell# cd/bash:cd:restricted# exitSpecific settings:# useradd test     

Linux Display login Shell information

Linux Display login Shell information[Email protected]:~$ finger-plogin Name Tty Idle Login time Office Office Phoneyouhaidong youhaidong *:0 Mar 8 22:10 (: 0) youhaidong youhaidong pts/0 Mar

Shell script programming (merge sort)

#!/bin/bash#shell Sorting of Scripts a= (1 3 5 7 9) b= (2 4 6 8) C=n=5m=7i=0j=0k=0while [$i-lt $n-a $j-lt $m];d OIF test ${a [$i]} -GT ${b[$j]};thenc[$k]=${b[$j]}j=$ (($j + 1)) k=$ (($k + 1)) elsec[$k]=${a[$i]}i=$ (($i + 1)) k=$ (($k + 1))

Shell script programming (Quick Sort)

#!/bin/bash#shell implementation of the fast sequencing of script programming (with the idea of a meta-point at the far right) a= (8 5 3 2 for 4 1 2 3-9, 8 6) #a = (0 0 0 0 1 2 3 3 4 4 8 30495 921 43716) temp=buff= #交换函数swap () {buff=${a[

Shell script sorting algorithm (bubble sort)

#/bin/basha= (9 0 345 1 2 1 0) #自己定义一个数组temp =for ((i=0;iThe array that is written above is the array sort that was previously defined in the code, and the following is the sort of array that the user customized during the execution.#/bin/basha= '

Shell script sort (bubble sort)

#/bin/basha= (9 0 345 1 2 1 0) #自己定义一个数组temp =for ((i=0;iThe above is sorted by a custom fixed array, the following is the user-defined input array to sort.#/bin/basha= ' expr $# + 1 ' #expr是一个计算操作, $ #是参数个数, $#+1 is because there are no storage

Recently discovered an artifact AutoHotkey, which can be likened to a shell script under the Windows graphical interface

Under the shell, what do we need to do to write a shell script and then run it;Win, you can write a AutoHotkey script, and then bind the shortcut keys, one click to run.Many tutorials on the web, such

Shell programming tmpwatch

Shell programming tmpwatch As a system administrator, you often need to regularly clear files with certain rules, such as expired logs, expired archives, and backed up files. If you use certain matching rules to find these files and pass them to the

Shell programming oracle10g installation preparations before rhel6.4, oracle10grhel6.4

Shell programming oracle10g installation preparations before rhel6.4, oracle10grhel6.4 OS: rhel6.4 Oracle: 10.2.0.1 Because oracle10g has been released for a long time and many packages used for 10g have been updated to a new version, many strange

Some common Shell commands

Some common Shell commands Common system commands] Passwd [hostname]Change Password Useradd [hostname]Add User Su-Switch to the root user Ssh [hostname]Ssh connection Cd [directory]Go to the directory Sudo chown [username]Grant corresponding

Shell script programming (quick sorting)

Shell script programming (quick sorting) #! /Bin/bash # implementation of fast sorting in shell script programming (using the rightmost element as the element) a = (8 5 10 3 2 93 4 1 2 3 40 9 61 8 6 29) # a = (0 0 0 0 1 2 3 3 4 4 8 28 30495 921 43716

Linux shell Command and execution script, linuxshell

Linux shell Command and execution script, linuxshell Http://blog.csdn.net/pipisorry/article/details/44681081 Cut all subfolders in the current folder to the current folder For dir in $ (ls)Do# Echo $ dirIf [-d $ dir-a "$ (ls-A $ dir)"]; thenMv./$

Total Pages: 541 1 .... 537 538 539 540 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.