If you're not familiar with the Linux shell array, see an article: The Linux shell array build and use techniques, this article is mainly about dynamically generating array series. There should be a lot of methods here, I mainly take a sum
Take a look at the wrong code first.
Copy Code code as follows:
#!/bin/bash
For x in ' LS */.*/.* '
Cat $x |do Echo $x
While Read line
Todo
C= ' echo $line |awk-f ' (' {print '} '
#echo $c
i=$ ((i+ $c))
Done
Echo
Done
Echo $i
Using the Rename command
========================
NAME
Rename-rename files
Synopsis
Rename from to File ...
========================
Copy Code code as follows:
#! /bin/sh
Inifile= "./dirlist.ini"
curpath=$ (PWD)
For Serverpath in $
Reads a file, assigns each row to an array of variables, and prints it out with a for loop
Copy Code code as follows:
#!/bin/sh
I=1
sum= ' sed-n ' $= ' tmp.txt ' #计算文件的总行数
echo "$SUM"
While Read line
Todo
arr[$i]= "$line"
1. Install MSMTP
luther@gliethttp:~$ sudo apt-get install msmtp
2. Edit the configuration script (~/.MSMTPRC is the default profile, or you can specify the profile path using the-C option)
luther@gliethttp:~$ Vim MSMTPRC
#添加如下内容
Defaults
#logfile/
Linux access to new Gmail Mail via command line without entering @gmail.com part
#!/bin/bash
num= "\033[1;36m"
end= \033[0m "
read-p" Enter your mail: "Name
read-p" Enter Pass of Mail: " Pass
atom= ' wget-qo-https://$name: $pass
Using Python for Web development, it is now popular to use UWSGI to invoke Python programs, but using UWSGI for a period of time to find that there is a disadvantage is that every time you change the source code must restart Uwsgi to take effect,
Writing a:
Copy Code code as follows:
#!/bin/bash
While Read line
Todo
echo $line #这里可根据实际用途变化
Done
Writing two:
Copy Code code as follows:
#!/bin/bash
Cat Urfile | While Read line
Todo
Echo $line
With Mint for some time, download basic with Firefox, and sometimes download a few g of the game. But Firefox didn't find the option to download the shutdown. In this reason, wrote this.
download_shutdown.sh
#!/bin/bash
# Created by: Demo
#
1. Wscript.Shell (Windows Script Host Runtime Library) is an object, and the corresponding file is C:\WINDOWS\system32\ Wshom.ocx,wscript.shell is a component that the server system will use. Shell is the meaning of "shell", this object can perform
The company has several servers running multiple memcached processes, in addition to monitoring their normal telnet, the existence of an instance to monitor their cache hit rate. Alarm for their cache hit rate.
There's a Perl written on the web
The first method (Gzexe):
This type of encryption is not a very safe method, but can satisfy the general encryption use, can conceal the password in the script and so on information.It is the use of the system's own Gzexe program, it is not only
When the server pressure is larger, running very laborious time. We often do Site page optimization, will go to find those pages are more frequent, and more time-consuming. Find the addresses that are high and time-consuming, and the related
The first 8 bits of a character variable are intercepted by the Linux shell, with the following methods:
Copy Code code as follows:
1.expr substr "$a" 1 8
2.echo $a |awk ' {print substr (, 1,8)} '
3.echo $a |cut-c1-8
4.echo $
5
1.ls-d *
Copy Code code as follows:
amosli@amosli-pc:~$ ls-d *
%appdata% Develop many Sorted.txt workspace
Bank Documents Music Space Download
2. Find.-type d-maxdepth 1
If you do not add-maxdepth parameters, then
There are two uses, one is lazy do not have to submit code, the second is used on the remote server for regular backups.
Copy Code code as follows:
sudo gedit/etc/crontab
When you open it, join the line.
Copy Code code
To get the absolute path of the executing program/script itself, you can use DirName (Realpath (__file__) in PHP, and C # has System.Windows.Forms.Application.StartupPath; Java does not seem to have any more direct method, can only use Codesource to
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