$# 是传给脚本的参数个数 $0 是脚本本身的名字 $1 是传递给该shell脚本的第一个参数 $2 是传递给该shell脚本的第二个参数 $@ 是传给脚本的所有参数的列表 $* 是以一个单字符串显示所有向脚本传递的参数,与位置变量不同,参数可超过9个 $$ 是脚本运行的当前进程ID...
分类:
系统相关 时间:
2014-08-12 13:12:54
阅读次数:
228
1. python中使用shell命令有多种方法,我自己觉得比较好用的是用commands模块:import commandsa,b = commands.getstatusoutput("ls -Al")a是退出状态(int类型), b是shell 命令的输出结果python -> shell:1...
分类:
编程语言 时间:
2014-08-12 13:11:34
阅读次数:
228
#include
#include
int main(int argc, char *argv[])
{
char str[80];
int i = 0;
for(i = 0; i
{
sprintf(str, "cp %s %d%s", argv[0], i, ".out"); //在WIN下用copy代替cp
system(str);
}
//printf...
分类:
编程语言 时间:
2014-08-12 10:25:13
阅读次数:
196
#includeint main(){int a[10];while(scanf("%d%d%d%d%d%d%d%d%d%d",&a[0],&a[1],&a[2],&a[3],&a[4],&a[5],&a[6],&a[7],&a[8],&a[9])==10){printf("%d %d %d %d ...
分类:
其他好文 时间:
2014-08-12 10:13:33
阅读次数:
183
#include int main(){ int m,n; while(scanf("%d,%d",&m,&n)!=EOF) { int i; for(i=m;i>0;i--) if(m%i==0&&n%i==0) break; printf("%d\n",i); } return 0; }
分类:
其他好文 时间:
2014-08-12 10:07:33
阅读次数:
201
python调用shell命令 1.1 ??os.system(command) ???????在一个子shell中运行command命令,并返回command命令执行完毕后的退出状态。这实际上是使用C标准库函数system()实现的。这个函数在执行command命令...
分类:
编程语言 时间:
2014-08-12 09:06:34
阅读次数:
240
Python学习第三天1.python的文件类型1)源代码Python源代码的文件以‘py’为扩展名,由python程序解释,不需要编译例1:vim1.py#!/usr/bin/python和shell脚本一样,需要注明有哪个程序解释)Print‘helloworld’Chmoda+x1.py./1.py运行结果为:helloworld2)字节代码Python源代..
分类:
编程语言 时间:
2014-08-12 03:39:14
阅读次数:
301
一、#!/bin/bash#自动添加用户,并使初始密码为用户账户名,且用户登录时强制其更改密码i=1while[$i-le15]doif[$i-le9]thenuseradduser0$iecho"user0$i"|passwd--stdinuser0$i&>/dev/nullchage-d0user0$ielseuseradduser$iecho"user$i"|passwd--stdinuser$i&>/de..
分类:
系统相关 时间:
2014-08-12 03:35:44
阅读次数:
242
1、转换文件格式,防止中文乱码:将excel保存成"CSV(逗号分隔)(*.csv)"格式,关闭文件,用记事本打开刚才保存的.csv文件,然后另存为UTF-8格式文本。需要注意的是,经过这样的转换,数字也全变成文本了。2、通过adb shell(adb.exe存放在android开发软件安装文件夹中...
分类:
数据库 时间:
2014-08-12 03:14:33
阅读次数:
269
Code:#include #include #include #define MAX 1000//给数组赋值void arrV(int a[],int len,int p){ int i; for(i=0;i-1;i--){ printf("%d",a[i]); }}//两个数组相加void a....
分类:
其他好文 时间:
2014-08-12 00:26:33
阅读次数:
216