Fun Bash Script: numerical calculation, bash script Numerical Calculation
6th articles
The mathematical operations in Bash are not as simple as other languages, because Bash treats all variables as strings, so a = 1 + 2, a is not equal to 3, but equal to string 1 + 2.
There are several solutions to solve this problem.OPERATOR []
a=2b=3c=$[a+b]d=$[a-b]e=$[a*b]f=$[a/b]g=$[a%b]
$ Is only the meaning of the
Batch configure SSH mutual trust script and ssh mutual trust script
During large-scale automated deployment, we often need to configure SSH mutual trust on the server so that the automated script can log on to the remote server without password. The general steps to manually configure SSH mutual trust are as follows:
Use ssh-keygen to generate a local ssh key (
first, the implementation1, parallel execution of commands, multiple commands separated by semicolons[Email protected] network-scripts]#Date;W.H.O.Tue May3 -: -: -Cst .Root Tty1 .- to-Geneva on: +Root pts/0 .- to-Geneva -: A(192.168.78.1)2. The first line of the shell script indicates that bash is required to execute#! /bin/bash3. Shell scripts are executed in sequence4. The single point operator represents the shell
This script removes un-needed script mappings in an IIS 5.0 Web server.Script mappings are the ISAPI DLLs or EXE ' s that execute webpages through IIS.This script requires administrator access, and ADSI 2.5 files.This script queries the IIS metabase and returns a multi-valued array list.The
The pig script does not need a suffix name to runpig脚本名为tempfile,无后缀名用pig -f tempfile 可直接运行另外,pig tempfile也可以直接运行This allows you to directly invoke the contents of the pig script in a python temporary fileA way for Python to invoke the pig script将pig脚本用任意文件存储,执行时写入python的临时文件(tempfile模块操作),执行结束后删除。执行过程: 用tempfile模块NamedTemporaryFile生成临时文件,名字默认随机,然后,可以用tempfile
Python timer usage + get script where absolute path + define log format test codeIf you write a script with a timer in Python, if the script also read the configuration file, then the configuration file path if you write to die, one day to change the directory, you need to change the script configuration file path, and
A script name is AAAA, if the script name (external and internal modification) BBBB, dragged to the prefab, the local operation will not have any problems, if you upload the project to SVN or packaged for other people to use, sometimes there will be a script loss of the pre-assembly.Workaround:Do not modify the aaaa script
Under linuxroot, the crontab is used to execute the php script. The is_writable folder in 777 is not writable, And it is okay to run the script directly on the command line. What is the problem? In linux root, the crontab is used to execute the php script. The is_writable folder in 777 is not writable, And it is okay to run the
If you want the script in Windows Script Host 5.6 to run when you need to modify the current directory where the script is running, build an Wscript.Shell object, and then set the CurrentDirectory Value property to the directory you want. For example, the following two lines will change the current directory to C:\TempSet Objshell = CreateObject ("Wscript.Shell")
Http://www.justwinit.cn/post/2295/
Every time you go to chmod-R *; chown-r nobody. nogroup * is very troublesome. Write a script to solve it. Then you can directly call the securecrt script -- run -- select the script!CodeAs follows:
Sub mainCRT. Screen. synchronous = trueCRT. Screen. Send "chmod-r 755 *" vbcrCRT. Screen. Send "chown-r nobody. nogroup *" vbc
Many of you are already using Greasemonkey, for example, in FF. However, it is not convenient to write your own scripts, so we will not write FF here.
After a certain version of CH, it does not support online installation of. user. js scripts. For the sake of security, you must drag the prepared scripts to the chrome: // chrome/extensions/page for installation.
When writing a script for the first time, you need to solve the following problems:
T
provide services for any page, the JavaScript scripts generated by the graphic Verification Code Service cannot conflict with the parent page, and supports IE, Firefox, and chromeUse guid to generate related elementid, functionname, and variables4. Use the dynamically generated script element to submit data across domains, refresh the page locally, delete the last generated dynamic script element before th
Xtrabackup automatic backup script and xtrabackup script
# Backup. sh #! /Bin/sh # on xtrabackup 2.2.8 # When you execute it for the first time, it will check whether there is a full backup. Otherwise, create a full database backup first. # When you run it again, it will perform Incremental Backup Based on the settings in the script based on the previous full or
97. Simulate functional programming in Lotus script, 97 Lotus script
This article describes 96. Techniques for simulating functional programming in Lotus script used by common field modifiers.Functional Programming
Functional programming is a beautiful and powerful programming paradigm. It is derived from the Lambda algorithm proposed by Alonzo Church. A problem
Nginx start, close, and reload the script, and nginx start and load the script
#! /bin/sh# Default-Start: 2 3 4 5# Default-Stop: 0 1 6# Short-Description: starts the nginx web serverPATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/binDESC="nginx daemon"NAME=nginxDAEMON=/usr/local/nginx/sbin/$NAMECONFIGFILE=/usr/local/nginx/conf/$NAME.confPIDFILE=/usr/local/nginx/logs/$NAME.pidSCRIPTNAM
1. Write a shell script and a shell script
I. shell and shell scripts
In linux, the text starting with #/bin/bash is interpreted by the shell interpreter.
Shell is an application that provides an interface through which users can access the services of the operating system kernel.
Shell script is a script program w
The first stepRun command to close Nginx firstsudo kill ' cat/usr/local/nginx/logs/nginx.pid 'Step TwoVi/etc/init.d/nginxEnter the following content#!/bin/sh## Nginx-this script starts and stops the Nginx daemin## Chkconfig:-85 15# Description:nginx is an HTTP (s) server, HTTP (s) reverse \# Proxy and IMAP/POP3 proxy server# Processname:nginx# config:/usr/local/nginx/conf/nginx.conf# Pidfile:/usr/local/nginx/logs/nginx.pid# Source function library.. /
1. When the shell script executes the Python script, you need to use the return value of the Python script to determine the command to be executed by the following program
Example: There are two py programs hello.py
Copy Code code as follows:
def main ():
Print "Hello"
If __name__== ' __main__ ':Main ()world.py
def main ():Print "Hello"
Occurs when a direct script is PowerShell:
File ******.PS1 cannot be loaded because scripts are not allowed in this system. For more information, see "Get-help about_signing".Location: 1 Characters: 17+ E:\Test\test.ps1 + categoryinfo:notspecified: (:) [], Pssecurityexception+ fullyqualifiederrorid:runtimeexception
View "Get-help about_signing":
Theme
About_signing
Brief description
Explains how to sign a sc
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.