echo

PHP上传图片

心已入冬 提交于 2019-12-28 08:13:04
首先需要一个表单,点击提交按钮提交至upload_file.php文件   <form action="upload_file.php" method="post" enctype="multipart/form-data"> <label for="file">Filename:</label> <input type="file" name="file" id="file" /> <br /> <input type="submit" name="submit" value="Submit" /> </form>    upload_file.php文件如下 <?php if ((($_FILES["file"]["type"] == "image/gif") || ($_FILES["file"]["type"] == "image/jpeg") || ($_FILES["file"]["type"] == "image/pjpeg")) && ($_FILES["file"]["size"] < 2000000)) { if ($_FILES["file"]["error"] > 0) { echo "Return Code: " . $_FILES["file"]["error"] . "<br />"; } else { echo "Upload: " . $

Software-BAT Tool Rename Tool

扶醉桌前 提交于 2019-12-28 07:58:46
When we use keil IAR, etc, you can prepare a template, and then copy it directly. It become troublesome when you want to rename files, and even its content. I select some code from Internet and write a bat file. copy the red code below into a txt file, then change its extension to bat.OK. Double click! @echo off echo Name : Universal Rename Tool echo Function: Change files name and replace string of files echo Author : Code is From Internet. All rights belong to Original Author. echo Modified by Jacob Lui echo Version : v1.0 echo Contact : iamlvshijie@gmail.com setlocal echo "First Change

进程守护神

岁酱吖の 提交于 2019-12-28 07:57:02
@echo off set _task=notepad.exe set _svr=c:\windows\notepad.exe set _des=start.bat :checkstart for /f "tokens=5" %%n in ( 'qprocess.exe ^| find "%_task%" ') do ( if %%n==%_task% (goto checkag) else goto startsvr ) :startsvr echo %time% echo ********程序开始启动******** echo 程序重新启动于 %time% ,请检查系统日志 >> restart_service.txt echo start %_svr% > %_des% echo exit >> %_des% start %_des% set/p=.<nul for /L %%i in (1 1 10) do set /p a=.<nul&ping.exe /n 2 127.0.0.1>nul echo . echo Wscript.Sleep WScript.Arguments(0) >%tmp%\delay.vbs cscript //b //nologo %tmp%\delay.vbs 10000 del %_des% /Q echo ********程序启动完成***

How to use shell commands in Makefile

梦想与她 提交于 2019-12-28 07:35:19
问题 I'm trying to use the result of ls in other commands (e.g. echo, rsync): all: <Building, creating some .tgz files - removed for clarity> FILES = $(shell ls) echo $(FILES) But I get: make FILES = Makefile file1.tgz file2.tgz file3.tgz make: FILES: No such file or directory make: *** [all] Error 1 I've tried using echo $$FILES , echo ${FILES} and echo $(FILES) , with no luck. 回答1: With: FILES = $(shell ls) indented underneath all like that, it's a build command. So this expands $(shell ls) ,

Echo off in Jenkins Console Output

混江龙づ霸主 提交于 2019-12-28 03:52:04
问题 I'm following guideline how to sign Android apk with Jenkins. I have parametrized Jenkins job with KSTOREPWD and KEYPWD. A part of Jenkins' job configuration (Build->Execute shell) is to take those parameters and store them as environment variables: export KSTOREPWD=${KSTOREPWD} export KEYPWD=${KEYPWD} ... ./gradlew assembleRelease The problem is when the build is over anybody can access the build "Console Output" and see what passwords were entered; part of that output: 08:06:57 + export

Echo off in Jenkins Console Output

大憨熊 提交于 2019-12-28 03:52:01
问题 I'm following guideline how to sign Android apk with Jenkins. I have parametrized Jenkins job with KSTOREPWD and KEYPWD. A part of Jenkins' job configuration (Build->Execute shell) is to take those parameters and store them as environment variables: export KSTOREPWD=${KSTOREPWD} export KEYPWD=${KEYPWD} ... ./gradlew assembleRelease The problem is when the build is over anybody can access the build "Console Output" and see what passwords were entered; part of that output: 08:06:57 + export

strstr(),strchr()

别说谁变了你拦得住时间么 提交于 2019-12-28 01:27:52
  strstr($a, $b)和strchr()一样,起的别名,表示查找$a中第一次出现$b,并返回字符串的剩余部分: 。strrchr()从后往前查第一个出现的 直接写两行代码: <?php $str = 'abc0'; echo strstr($str, '0');// 0 echo '<hr/>'; echo strstr($str, '0') == '0';// 1 echo '<hr/>'; // 注意两个等号和三个等号的区别,字符串0和false 强制转换后是一样的。 所以应用时 要使用 === echo strstr($str, '0') == false; echo '<hr/>'; echo strstr($str, '0') === false;// false echo '<hr/>'; $str = 'abcabcdefg'; // 很常见的一个substr()和strchr()联合用法,取这个字符的后边出现的 echo substr(strchr($str, 'd'), 1);// efg echo '<hr/>'; // 也可以这样 当然要知道'd’有没有,可以判断下!==false echo substr($str, stripos($str, 'd')+1);// efg echo '<hr/>'; // 从后往前查第一个f出现 echo

shell脚本

别等时光非礼了梦想. 提交于 2019-12-28 00:45:06
#shell 脚本随机数 #!/bin/bash echo -e “\033[34m 游戏开始!!! \033[0m” while : do random_number=$(shuf -i 10-99 |head -1) # echo $random_number for i in $(seq 3) do read -p "请输入你猜的数字大小:" guess_number if [ $random_number -gt $guess_number ] then echo "猜小了!" elif [ $random_number -lt $guess_number ] then echo "猜大了!" else read -p "恭喜你,猜对了,是否继续玩游戏(y/n):" judge if [ $judge == "Y" -o $judge == "y" ] then break else echo -e "\033[34m 欢迎大佬下次在玩!\033[0m" exit fi fi echo "你还有$(expr 3 - $i)次机会!" if [ $(expr 3 - $i) == 0 ] then read -p "恭喜你,猜对了,是否继续玩游戏(y/n):" judge if [ $judge == "Y" -o $judge == "y" ] then break

if-for-while

筅森魡賤 提交于 2019-12-27 14:02:41
if help if可以看看if的用法 if ls -l / ;then echo "ok";else echo "no" ;fi for for ((i=0;i<10;i++));do echo $i; done help for里面的words:asd asd asd,word:asd for i in aaa fff ssss aaaa;do echo $i;done 命令seq,比如seq 33:从1输出到33 for i in `seq 33`;do echo $i;done while help while 练习 先统计一下,并用数值法并倒过来排个序:du -a | sort -nr 思想:把统计结果逆序排列,然后开始循环,把第一个是文件的输出即可。 编程: oldIFS=¥IFS:bash是通过IFS里面的值来进行切割的,之前存的是空格,换行,制表符,这次要换成换行符,不过先保存现场。 IFS=$'\n':加单引号是为了使得\和n合为一体,$表示取它的值 接着``里面是按照逆序r排列的,对用户输入的路径的所有文件和目录的大小信息的数据集,增强for循环遍历里面的每一个元素。 for i in `du -a $1 | sort -nr`; do   echo $1   filename=`echo i | awk '{print $2}'` :

【shell】整数运算,小数运算

↘锁芯ラ 提交于 2019-12-27 06:32:00
【shell】整数运算,小数运算 1.整数运算 【demo01】expr typeset x=10 typeset y=2 n1=`expr $x + $y` n2=`expr $x - $y` n3=`expr $x \* $y` #使用expr时 符号* 需要转义 n4=`expr $x / $y` n5=`expr $x % $y` echo n1=$n1,n2=$n2,n3=$n3,n4=$n4,n5=$n5 【demo02】小括号 typeset x=10 typeset y=2 ((n1=$x+$y)) ((n2=$x-$y)) ((n3=$x*$y)) ((n4=$x/$y)) ((n5=$x%$y)) echo n1=$n1,n2=$n2,n3=$n3,n4=$n4,n5=$n5 echo $(($x+$y)) echo $(($x-$y)) echo $(($x*$y)) echo $(($x/$y)) echo $(($x%$y)) 说明:((n1=$x+$y)) 等价于 n1=`expr $x + $y` 【demo03】中括号 typeset x=10 typeset y=2 echo $[$x+$y] echo $[$x-$y] echo $[$x*$y] echo $[$x/$y] echo $[$x%$y] 【demo04】let typeset x