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.
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
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 #
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:
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/$
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
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
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
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
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
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
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
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
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