Linux
shell脚本中shift的用法说明
shift命令用于对参数的移动(左移)。
示例1:依次读取输入的参数并打印参数个数:
run.sh:
#!/bin/bash
while [ $# != 0 ];do
echo "第一个参数为:$1,参数个数为:$#"
shift
done
输入如下命令运行:run.sh a b c d e...
分类:
系统相关 时间:
2014-05-01 22:06:54
阅读次数:
475
用YII很久了今天看老代码发现了一个致命又气人的bug: “'SiteController cannot find the requested view "index". ”
在这个项目里对应的views/site/index.php文件都有,但是为什么还报了这个错呢, 于是开始看内核代码:
public function getViewFile($viewName)
{
if(($t...
分类:
其他好文 时间:
2014-05-01 21:59:39
阅读次数:
454
jQuery获取Select选择的Text和Value:
语法解释:
1. $("#select_id").change(function(){//code...}); //为Select添加事件,当选择其中一项时触发
2. var checkText=$("#select_id").find("option:selected").text(); //获取Select选择的Text
...
分类:
Web程序 时间:
2014-05-01 17:38:42
阅读次数:
420
Given an array of integers, find two numbers
such that they add up to a specific target number.The function twoSum should
return indices of the two nu...
分类:
其他好文 时间:
2014-05-01 08:35:40
阅读次数:
443
Sed 是什么?Sed 是一个脚本型的编译器,是非交互式的,也就是说sed与常见的编译器不同(比如说vim),sed没有交互式的编辑界面以及光标移动或者庞大的快捷键/功能,sed 的使用就是很简单的一个脚本行,相当极客吧?Sed 是最早支持正则表达式的工具之一,并且至今仍然被人们用做文本处理,特别是在其强大的替代命令。本文力求详尽的介绍 sed 的使用,希望你能喜欢!...
分类:
其他好文 时间:
2014-04-30 22:33:38
阅读次数:
360
一、正则表达式的使用
cd /usr/share/dict
1、找出words文件下所有以a开头t结尾的单词
egrep "^a.*t$" words
2、匹配以abcde开头,以at结尾的单词
egrep "\" words
3、以大写字母开头,以t结尾
egrep "^[[:upper:]]t$" words
二、管道的使用
egrep "^a.*t$" words|wc -...
分类:
系统相关 时间:
2014-04-30 22:32:38
阅读次数:
372
Can you find it?
Time Limit: 10000/3000 MS (Java/Others) Memory Limit: 32768/10000 K (Java/Others)
Total Submission(s): 9863 Accepted Submission(s): 2587
Problem Description
Give you...
分类:
其他好文 时间:
2014-04-29 13:33:20
阅读次数:
300
在Linux系统中,OpenSSH是目前最流行的远程系统登录与文件传输应用,也是传统Telenet、FTP和R系列等网络应用的换代产品。其中,ssh(Secure Shell)可以替代telnet、rlogin和rsh,scp(Secure Copy)与sftp(Secure FTP)能后替代ftp。...
分类:
其他好文 时间:
2014-04-29 13:28:21
阅读次数:
357
需求:后台(指管理员后台)上传一个html模板到文件服务器上,前台(商家操作的平台)读取到模板,并填充数据,生成新的vm页面到webapp/WEB-INF/view目录下,用于预览、保存、打印。
最开始的代码:
@Test
public void test() throws Exception{
String templateUrl = baseServic...
分类:
Web程序 时间:
2014-04-29 13:11:21
阅读次数:
465