#!/bin/sh is_dir(){ for loop in `ls $1` do if [ -d $loop ] then echo d is_dir $loop elif [ -f $loop ] then echo f is_file $loop else echo "不知道什么类型" #为什么传到这里的参数就判断不出它的类型? fi done } is_file(){ ls -l $1 } for loop in `ls -l /root` do if [ -d $loop ] then is_dir $loop ...
by meloncao - Shell - 2007-03-09 17:42:52 阅读(1119) 回复(1)
本帖最后由 sundae333 于 2015-05-21 10:41 编辑 #define SIGGETIMER (SIGRTMAX) static void GlobalTimerHandler(int signo, siginfo_t* info, void* context) { CGeTimer *pTimer; if( signo != SIGGETIMER ) return; pTimer = (CGeTimer*)(info->si_ptr); pTimer->handler(); } 函数是信号处理函数(实时信号64) 注册代码(sigaction): sigemptyset(&sysact.sa_mask); sysact.sa_flags = SA_SIGINFO; sy...
本帖最后由 chengengsen 于 2011-12-07 09:34 编辑 今天看了C primer plus 第222-223页关于函数传参的部分,有点不明白,说出来大家讨论一下:[code]int imax(); int main() { .......... imax(3.0,5.0); ........... } int imax() int n,int m; { ............ }[/code]1.作为参数传递时,float类型会被转换为double类型,所以两个double类型的数值被压入栈,imax()从栈中读取两个int类型数值是,它会读出64位数据,读取...
本帖最后由 灰菲湮灭 于 2010-12-01 16:41 编辑 [code] type=1 function getNthVal { echo "$1" } if [ "$type" = "1" ];then for ((i=0; i<4; i++));do getNthVal $i done elif [ "$type" = "2" ];then echo "type" fi[/code]如上所示,我想在echo $打印出来0,1,2,3,但这样写打出来的是i,如何解决呢? 谢谢 已解决。。。。唉
[code]a(){ char *a[10][10] ; ... b(a); } b(char ***b){ ... } [/code] b(a) ; ----这样调用行吗?怎么会有warning: parsing arg 1 of 'b' from incompatible pointer type.
#!/usr/local/bin/php -q [lu@so uprbtcl]$ php test.php 1 2 3 Hello, 1 2! How are you today? ~~小试成功!! PHP作为Shell脚本时有一个内嵌的数组“$argv”,使用“$argv”数组可以很方便的读取Shell脚本运行时候的参数 开心中~ 本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/1184/showart_62754.html
C语言 mysql select 查询,怎样传参啊? 比如: char *sql="select passwd from user_info where user_id='account'"; account是个变量,查询出来总是 “-1行受到影响”!是参数没传进去吗?
[code]bsd# perl -e '$b="cd";sub a { print "@_\n"; $_[1]="uu";} a("a",$b); print "$b\n"' a cd uu bsd# perl -e '$b="cd";sub a { print "@_\n"; $_[1]="uu";} a("a","$b"); print "$b\n"' a cd cd bsd# [/code]
本帖最后由 cao627 于 2015-01-03 10:40 编辑
[code] include
最近一直在学C语言:但是今天遇到了一个问题,想了很久也没想明白。问题描述如下: void receive_data(struct sockaddr_in *save) { struct sockaddr_in *client_ip; client_ip=(struct sockaddr_in *)malloc(sizeof(struct sockaddr_in)); client_ip->a=0; client_ip->b=1; client_ip->c=2; save=client_ip; } int main() { struct sockaddr_in *client_ip; client_ip=NULL; receive_data(client_ip); ...