ChinaUnix.net
相关文章推荐:

expected expression before '' token

(原标题为:求解:一个菜鸟编程中的问题!) 编写了一个shell命令cp 代码如下: #include #include #include #include #define maxOnce 1024 int main(int argc,char * argv[]) { int fdsrc,fddist; char buf[maxOnce]; char buf1[maxOnce]; int size; if(argc!=3) printf("error for input\n"); if((fdsrc=open(argv[1],O_RDONLY)==-1) perror("error for open\n ");//出错...

by melonmelon - C/C++ - 2006-12-28 20:35:32 阅读(4243) 回复(10)

相关讨论

我用 if [ $i -eq 100 ] 就出现了这个错误:integer expression expected 从字面上理解就是变量i应该是个integer类型的 但是如何把一个字符型数字转换成整形呢?

by cuer_2 - Shell - 2009-06-01 16:21:21 阅读(13981) 回复(11)

#include typedef struct{ int adr[3][3]; }MazeType; main() { MazeType maze; /*maze.adr[3][3]={ {'0','1','1'}, {'1','0','1'}, {'1','1','0'} };*/ maze.adr[3][3] = { {0,1,1}, {1,0,1}, {1,1,0} }; } error information : 13: error: syntax error before '{' token I don't know how to resolve it , Please ... TX a lot

by addictlinux - C/C++ - 2008-12-24 23:08:53 阅读(4483) 回复(5)

#include int size(int num) {     char array[num+2];     return sizeof(array); } int main() {     printf("%d\n",size(4));     return(0);   } 为什么在vc里编译不过?

by lxbkey - C/C++ - 2008-08-02 11:59:25 阅读(8843) 回复(4)

#!/bin/sh count=2 while [ 0 ];do if [ $count%2 -eq 0 ];then date -s 12:12:00 fi if [ $count%2 -ne 0 ];then date -s 12:34:00 fi sleep 10 let count=$count+1 done 结果如下: ./changetime.sh: line 6: [: 2%2: integer expression expected ./changetime.sh: line 9: [: 2%2: integer expression expected 我又使用了"$count%2" 还是这个问题,点解?

by loveoov - Shell - 2007-10-26 17:40:38 阅读(8209) 回复(1)

我的程序如下: NUM=`awk '/NUM/{sub(/NUM=/,"");print}' $DIR/logzdm.ini` processID=1 while [ $processID -le $NUM ]; do values=DEBUGLOG${processID}= process_content=`grep $values $DIR/logzdm.ini | awk -F= '{print $2}'` ; echo $process_content | sed 's/\"\"*//g' ; processID=`expr $processID + 1`; done logzdm.ini 文件内容: #プロセスの件数 NUM=12 ------------------NUM 数每次都可能变化,并且...

by twanger - Shell - 2006-05-29 15:30:56 阅读(7851) 回复(10)

这段shell在一个嵌入式系统上运行超过48小时,有很大几率出现integer expression expected的问题。请大家帮帮忙,看一下。 ********************************************************************* #!/bin/sh #try try_1() { cd /xx/ find /xx/ ! -type d | xargs ls -trl | sed '/bak/d' | awk '{print $9}' | sed -n '1,6p' | xargs rm -f>/dev/null 2>&1 delete } main() { sleep 5 choice } choice() { used=`df | awk...

by winpad - Shell - 2011-03-14 17:34:33 阅读(2445) 回复(7)
by liufeinwpu - 程序开发 - 2006-12-20 09:50:25 阅读(862) 回复(1)

AS Regular expression A regular expression is a pattern to match against an input string. By building a regular expression we specify a string that input must match. In case of BGP we are specifying a string consisting of path information that an input should match. In the previous example we specified the string ^200$ and wanted path information coming inside updates to match it in order to perfo...

by joiner - 网络技术文档中心 - 2005-08-26 07:39:04 阅读(675) 回复(0)

以下是port.sh的内容 #! /bin/bash # program: Using to study the [if... then ...fi] program # Written by :Beyond # date: 2007/06/15 # content: I will be using this program to show your services # 1. print the program's work in your screen echo "Now, the services of your Linux system will be detect!" echo "The www, ftp, ssh, and sendmail + pop3 will be detect!" echo " " # 2. www www='netstat ...

by beyond911 - Shell - 2007-06-17 13:35:31 阅读(14979) 回复(2)