The substitution of several basic commands in a shell script under Linux _linux shell

Part 1: ' Command ' This is the "command standard output as a function of standard input" method of operation, there are great drawbacks and unsafe places. disadvantage one: relatively old. disadvantage two: easy to confuse with single quotes.

Shell script echo output does not wrap function enhancement instance _linux Shell

This is the 8th/101 script There are as many ways to solve this quirky echo problem as There are the pages in this book. One of my favorites is very succinct: function Echon { echo ' $* ' | awk ' {printf '%s ' $} ' } You could prefer to

Hosts one-button deployment script in Script_tool_for_linux.bash:Linux environment _linux Shell

The hosts one-click Deployment Script under Linux Environment, @lstoars contribution; @fluviusmagnus provides an enhanced version. Official website: https://github.com/racaljk/hosts/tree/master/hosts_tools #!/bin/sh # # Script_tool_for_linux #

Wscript.Shell Object Specialfolders Property does not expose document sharing _vbs

Special folder names are used to index the collection to retrieve the special folders that are required, and the following special folders are listed in the document:

Linux some common shell scripts to organize _linux shell

How to calculate the number of files and directories in the current directory # ls-l * |grep "^-" |wc-l----to count files # ls-l * |grep ' ^d ' |wc-l-----to Count dir How do I just column subdirectories? Ls-f | grep/$

The shell script implementation classifies files according to the time the file was modified _linux shell

#!/bin/bash # exctute #/mod.sh File_type input_folder Output_folder #/mod.sh Count I f [! $#-eq 3]; then echo "[ERROR] Error paramater." Exit Fi # File Type file_type= ' ${1} ' # input Foloder if [-d ' ${2} ']; Then folder= "${2}" Else echo

Introduction to Shell comparison operations _linux Shell

Shell string Comparisons, judging whether it's a number Binary comparison operator, comparing variables or comparing numbers. Note the difference between numbers and strings. Integer Comparisons -eq equals, such as: if ["$a"-eq "$b"] -ne is

Expect automatic detection and restart program code on another server _linux shell

[s005 you] # cat Haproxy_expect Copy Code code as follows: #!/usr/bin/expect Set Ssh_user "Fivetrees" Set Password "123456" Spawn ssh-i/root/.ssh/$ssh _user Server004.xd.com Expect_before "No"? { Send "yes\r"} Sleep 0.5

Shell custom Function and parameter invocation parsing _linux shell

One, the definition function Copy Code code as follows: function fname () { statements; } Or Copy Code code as follows: FName () { statements; } Second, call function You can call a

A shell-written ping function _linux Shell

Copy Code code as follows: #!/bin/bash #2013 -01-06 14:00:00 wanggy Exp #note:p ing Monitor Set-u #set-X Ping_fun () { d_network=192.168.1 Echo-n "Input" network (default $d _network): " Read Network : ${network:= $d _network} echo

Linux uses expect script to implement remote machine automatic login _linux Shell

First, create a expect script ssh_expect, which reads as follows: #!/usr/bin/expect-f set hostname [lindex $argv 0] set user [lindex $argv 1] set passwd [lindex $argv 2] s Et timeout set force_conservative 1 if {$force _conservative} { set

Shell generates a simple format XML instance _linux shell

Here's the shell code:create_xml.sh Copy Code code as follows: #! /bin/bash #author: Dengzhaoqun#date: 201202/14 Outfile=outTabs=0 Put () {Echo ' ' >> $outfile} Put_head () {Put '? ' ${1} '? '} Out_tabs ()

Get two-day-interval shell script code _linux Shell

Copy Code code as follows: #!/bin/sh # Get the first day of the quarter, the date interval to yesterday # link:www.jb51.net # DATE:2013/2/28 Day= ' date-d "1 days Ago" "+%y%m%d";year= ' expr substr ${day} 1 4 ';Month= ' Expr

Linux bash string processing encyclopedia _linux Shell

Gets the length of the string Copy Code code as follows: Code: %x= "ABCD" #方法一 %expr length $x 4 # method Two %echo ${#x} 4 # method Three %expr "$x": ". *" 4 # Help for expr # String:regexp anchored pattern

Used to record shell scripts that use commands after login _linux shell

Copy Code code as follows: #/bin/bash # History After #把以下代码直接粘贴到/etc/profile user_ip= ' who-u am I 2>/dev/null| awk ' {print $NF} ' |sed-e ' s/[()]//g ' Histdir=/var/log/.hist If [-Z $USER _ip] Then User_ip= ' hostname ' Fi if [!-D

Shell script Register to Linux system service instance _linux shell

Sign up for a system service to boot from. 1 Script Authoring #vim test.sh Copy Code code as follows: #!/bin/bash #description: hello.sh #chkconfig: 2345 20 81 exec_path=/usr/local/ exec=hello.sh daemon=/usr/local/hello.sh

Linux Shell Implementation Daemon Script _linux Shell

Embedded beginners, the first time to upload code. Yesterday did a UDHCPD and Udhcpc Guardian, currently only with Shell imitation writing, what method can do guardian? #! /bin/sh #进程名字可修改 pro_name=udhcpc wlan=ra0 while true; # get

The shell script implements the bulk download resource and retains the original path _linux shell

Sample Resources Listsuch as Url.txt: Copy Code code as follows: Http://su.bdimg.com/static/superplus/img/logo_white_ee663702.png Http://su.bdimg.com/static/superplus/img/logo_white_ee663703.png

SHELL Script Bulk Add Delete user

#!/bin/bash##Read-p "Keyin Add or del:" KeyinFor i in ' seq-w ';d oPassword=user$i ' echo $RANDOM | md5sum | Cut-c 1-5 'Case $keyin inAddif! ID user$i &>/dev/null; thenUseradd user$i &>/dev/nullecho $password | passwd--stdin user$i &>/dev/nullecho

Architecture based on the application shell

What is an app shell (app shell)The app shell is the most basic HTML, CSS, and JavaScript required for the application's user interface, and a component to ensure that the application has a lot of performance. Its first load will be very fast and is

Total Pages: 541 1 .... 491 492 493 494 495 .... 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.