echo

Window下命令行的一些常用命令整理笔记——cmd实现ftp下载的批处理文件编写

时光毁灭记忆、已成空白 提交于 2020-01-16 16:05:26
编程中,用到从ftp上获取文件,因ftp是一个传输协议,无法直接读取其中的文件内容,只能进行下载。 此处,使用cmd的方法,来下载ftp上的文件( 在下方,后面附加解释说明) @ set nowdate= % date:~0 , 4% % date:~5 , 2% % date:~8 , 2 % @ set txtPath=D: / / ftptmp . txt @ set sourcePath=txt / file @ set destPath=D:\txt\ % date:~0 , 4 % \ % date:~5 , 2 % \ % date:~8 , 2 % if not exist % destPath % md % destPath % @ echo on echo open 192 . 168 . 0 . 1> % txtPath % echo weather>> % txtPath % echo weather1>> % txtPath % echo cd % sourcePath % >> % txtPath % echo prompt>> % txtPath % echo lcd % destPath % >> % txtPath % echo mget * % nowdate% * . TXT>> % txtPath % echo on ftp - s: %

PHP-009-【特殊变量】-服务器变量-$_SERVER

…衆ロ難τιáo~ 提交于 2020-01-16 03:16:13
$_SERVER涉及的内容太多了就不一一列出来 捡一些比较重要的来学习 可以直接运行下面的代码来查看 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <?php //时间戳(timestamp),通常是一个字符序列,唯一地标识某一刻的时间 echo "显示脚本开始运行时间:\"".$_SERVER["REQUEST_TIME"]."\"<br />"; echo "<hr />"; echo "显示脚本文件的相对路径和文件名:\"".$_SERVER["PHP_SELF"]."\"<br />"; echo "显示服务器使用的CGI脚本规范:\"".$_SERVER["GATEWAY_INTERFACE"]."\"<br />"; echo "显示当前运行脚本所在服务器的IP地址:\"".$_SERVER["SERVER_ADDR"]."\"<br />"; echo "显示当前运行脚本服务器名称:\"".$_SERVER["SERVER_NAME"]."\"<br />"; echo "显示当前运行脚本服务器标识:\"".$_SERVER["SERVER_SOFTWARE"]."\"<br />"; echo "显示请求页面的通信协议的名称和版本:\"".$_SERVER["SERVER

Bash速查表

折月煮酒 提交于 2020-01-15 21:27:58
例 #!/usr/bin/env bash NAME="John" echo "Hello $NAME!" 变量 NAME="John" echo $NAME echo "$NAME" echo "${NAME}!" 字符串引号 NAME="John" echo "Hi $NAME" #=> Hi John echo 'Hi $NAME' #=> Hi $NAME 条件执行 git commit && git push git commit || echo "Commit failed" 功能 get_name() { echo "John" } echo "You are $(get_name)" Shell执行 echo "I'm in $(pwd)" echo "I'm in `pwd`" # Same 条件语句 if [[ -z "$string" ]]; then echo "String is empty" elif [[ -n "$string" ]]; then echo "String is not empty" fi 扩展 echo {A,B}.js {A,B} 与...一样 A B {A,B}.js 与...一样 A.js B.js {1..5} 与...一样 1 2 3 4 5 严格的模式 set -euo pipefail IFS=$'\n\t' 参数扩展

删除空文件夹。删的干净。删的彻底。

邮差的信 提交于 2020-01-15 19:38:21
将下列代码复制到txt中保存。并把后缀.txt命成.bat。然后运行即可。 方案1.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx   删除指定目录及其子目录下的空文件夹.bat   代码: @echo off echo. echo 说明此工具会删除指定目录所在空文件夹及其子目录下的空文件夹,以节省空间. echo. echo. echo 本例只限删除10层内父子目录关系的所有空文件夹。 echo 10层以上请更改下面代码(1 1 10)中的10数字即可. echo. set /p par=请输入空文件夹所在的盘符或目录(如d:\或d:\a\),输入确认无误后请按回车: echo. echo 当前工作目录为: %par% echo 任意键 开始删除空文件夹 pause>nul echo ----------------------------------------------------------------------------- for /l %%i in (1 1 10) do ( for /f "delims=" %%a in ('dir /b/s/ad %par%') do ( 2>nul rd "%%a\"&&echo 成功删除空文件夹:%%a

nginx location指令详解

☆樱花仙子☆ 提交于 2020-01-15 13:35:29
location匹配的是nginx的哪个变量? $request_uri location的匹配种类有哪些? = 开头表示精确匹配 ^~ 开头 ,注意这不是一个正则表达式(是提升优先级的字符串匹配) –它的目的是优先于正则表达式的匹配。如果该location是最佳匹配,则不再进行正则表达式检测。 ~ 开头表示区分大小写的正则匹配; ~* 开头表示不区分大小写的正则匹配 !~ && !~* :表示区分大小写不匹配的正则和不区分大小写的不匹配的正则 字符串匹配 / 通用匹配, 如果没有其它匹配,任何请求都会匹配到 location搜索顺序 首先精确匹配 = 其次匹配 ^~ 再其次按照配置文件的顺序进行正则匹配 最后是交给 / 进行通用匹配 注意:当有匹配成功时,立刻停止匹配,按照当前匹配规则处理请求 特别注意:字符串匹配优先搜索,但是只是记录下最长的匹配 ,然后继续搜索正则匹配,如果有正则匹配,则命中正则匹配,如果没有正则匹配,则命中最长的字符串匹配。 ( 如果 ^~ 是最长的匹配,则会直接命中,停止搜索正则 ) 精确匹配 location = /images/test.png { echo 'config1'; } location /images/test.png { echo 'config2'; } location \/images\/test\.png$ { echo

数据库批处理文件

故事扮演 提交于 2020-01-15 12:30:08
数据库批处理文件 第一步配置环境变量 cd /d %~dp0 %1 start "" mshta vbscript:createobject("shell.application").shellexecute("""%~0""","::",,"runas",1)(window.close)&exit setx Path "%Path%;%~dp0\bin" -m 第二步安装数据库以及基本的配置 cd /d %~dp0 ::cd /d %~dp0的意思就是cd /d d:\qq ::%0代表批处理本身 d:\qq\a.bat ::~dp是变量扩充 ::d既是扩充到分区号 d: ::p就是扩充到路径 \qq ::dp就是扩充到分区号路径 d:\qq %1 start "" mshta vbscript:createobject("shell.application").shellexecute("""%~0""","::",,"runas",1)(window.close)&exit ::以管理员身份运行bat文件 @echo off ::这个命令叫做“回显” cd /d %~dp0 ::同上 del /F %cd%\my.ini ::删除一个或数个文件。 ::DEL [/P] [/F] [/S] [/Q] [/A[[:]attributes]] names ::names

Echo doesn't show copy-pasted text from txt file to form text area PHP

╄→гoц情女王★ 提交于 2020-01-15 12:05:53
问题 This is maybe a stupid problem to solve but i've looked around and i can't manage to find a viable solution. I'm making a simple form where: the user write some text into text-areas the php must echo back those data into a simple html code to copy it somewhere else something like this: http://www.w3schools.com/php/showphp.asp?filename=demo_form_validation_complete but there is a problem even in the demo from w3schools: when i have some text into a *.txt file or another web page/local document

Using data in an array

删除回忆录丶 提交于 2020-01-15 11:56:07
问题 On my php page, I am getting the follow output: Array ( [contact/email] => users_name@email_address.com ) This is produced via the following line in the php code: print_r($openid->getAttributes()); How do I extract the text users_name@email_address.com from that array and stick it into a variable $strEmail; ? So when I echo the variable: echo $strEmail; It should output the following on screen: users_name@email_address.com 回答1: Assign the array to a variable and then you can easily access it:

case语句,循环语句

北城以北 提交于 2020-01-15 10:01:33
case语句,循环语句 vim 名字也不能乱写 比如 vim rsync.sh 应为后面需要pkill rsync 会把文件一起删掉 1.case流程控制语句 case 变量名4 in 模式匹配1) 命令的集合 ;; 模式匹配2) 命令的集合 ;; 模式匹配3) 命令的集合 ;; *) *的下一行不需要有;; echo USAGE[$0 1|2|3] esac [root@shell /server/scripts]# cat case.sh #!/bin/bash ############################################################## # File Name: case.sh # Time: 2019-11-04-09:43:18 # Author: msy ############################################################## case $1 in Linux) echo linux... ;; Shell) echo shell... ;; MySql) echo mysql... ;; *) echo "USAGE $0 [Linux|Shell|MySql]" esac [root@shell /server/scripts]# sh case.sh Linux

case语句,函数及中断控制,字符串处理

天涯浪子 提交于 2020-01-15 08:23:22
case语句 case分支,功能类似if,不如if强大,代码比if精简 case分支属于匹配执行的方式,它针对指定的变量预先设置一个可能的取值,判断该变量的实际取值是否与预设的某一个值相匹配,如果匹配上了,就执行相应的一组操作,如果没有任何值能够匹配,就执行预先设置的默认操作。 case 变量 in 模式1) 指令1;; 模式2) 指令2;; *) 指令n [root@server0 opt]# vim test03.sh #!/bin/bash case $1 in t) touch $2;; #创建文件 m) mkdir $2;; #创建目录 r) rm -rf $2;; #删除 *) echo "请输入t|m|r" esac [root@server0 opt]# bash test03.sh t poi [root@server0 opt]# ls poi rh test01.sh test02.sh test03.sh [root@server0 opt]# bash test03.sh m qwer [root@server0 opt]# ls poi qwer rh test01.sh test02.sh test03.sh [root@server0 opt]# bash test03.sh r poi [root@server0 opt]# bash test03