ChinaUnix.net
相关文章推荐:

integer expression expected

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

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

相关讨论

#!/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 阅读(8213) 回复(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)

#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 阅读(8848) 回复(4)

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 阅读(14982) 回复(2)

(原标题为:求解:一个菜鸟编程中的问题!) 编写了一个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 阅读(4244) 回复(10)

原代码如下: fsmax="85" maillist1="[email]cold@163.com[/email]" maillist2="[email]hot@163.com[/email]" df -k | grep '/dev/h' | awk '{print $1,$5,$6}'>mailfile mail -s "Filesystem Information" $maillist1 < mailfile mail -s "Filesystem Information" $maillist2 < mailfile df -k | grep '/dev/h' | awk '{print $5}'>outfile while [ read fsvalue ] do fsvalue=$(echo $fsvalue | sed 's/\%//') ...

by wwmshe - Shell - 2006-05-17 14:13:03 阅读(1231) 回复(1)

I need to check the application status from cluster system: my status out put file format as : #--------------------------------------------- # Package Status #--------------------------------------------- #Package HostName Status #------- -------- ------ #-------------- #Local Site localhost03 #-------------- monitor host103 UP systemwatch ...

by qiangx - Perl - 2009-05-29 21:32:46 阅读(1452) 回复(7)