shell脚本运行报错

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/huifeidedabian/article/details/76521828

运行环境:在8909平台运行android5.1

报错: syntax error: 'while' unmatched

原因:windows和ubuntu写出的脚本的换行符不同;具体可以参考http://blog.csdn.net/wjcquking/article/details/6634504

            因此需要在ubuntu环境下编写,在使用adb命令push到终端去执行

代码片段:

#!/bin/bash
cat /d/mdp/stat
people[4]=jijianwen
echo ${people[@]}
while [ 1 ]
do
    cat /d/mdp/stat
done





展开阅读全文

运行报错

03-18

运行中断,显示“FPS.exe中的0x77661884处未处理的异常:0xC0000005:读取位置0xfff7ffff时发生访问冲突”,请问这是什么意思啊?谢谢rnrn在main函数里调用这个tridag(u,data_out_b,lambda,m);就出错,不用这句话就好了rnrn下面是代码,rn[code=C/C++]#includern#includern#includern#define PI 3.1415926rnusing namespace std;rnvoid lu_lower(double d[],double e[],double b[],double x[],int n)rnrn x[0]=b[0]/d[0];rn int count;rn for(count=1;count<=n-1;count++)rn rn x[count]=(b[count]-e[count-1]*x[count-1])/d[count];rn rnrnvoid lu_upper(double d[],double e[],double b[], double x[],int n)rnrn x[n-1]=b[n-1]/d[n-1];rn int count;rn for(count=n-2;count>=0;count--)rn rn x[count]=(b[count]-e[count]*x[count+1])/d[count];rn rnrnvoid tridag(double u[],double r[],double lambda,int n)rnrn double d[10];//按照实际情况调整rn double e[9];rn double temp[10];rn d[0]=sqrt(lambda);rn e[0]=-1/d[0];rn int count;rn for(count=1;count<=n-2;count++)rn rn d[count]=sqrt((lambda-d[count-1]*d[count-1]));rn e[count]=-1/d[count];rn rn d[n-1]=sqrt((lambda-d[n-2]*d[n-2]));rn lu_lower(d,e,r,temp,n);rn lu_upper(d,e,temp,u,n);rnrnint main()//最终结果在temp里,把它拉成一维看就行rnrn int m=10;//FFT的维数,符号和书上统一rn int dm=2*m;//把N化成2N,才能用FFT求解rn int p=1;//符号和书上统一rn double data_out_b[10];rn double u[10];//追赶法的解向量rn int count;rn int count1;rn double lambda;rn double temp[1][10]=1,2,3,4,5,6,7,8,9,10;//存放b的数据,一共有m*p个,p行m列rnrnrnrn rn fftw_complex *in;rn fftw_complex *out;rn fftw_plan plan;rn in=(fftw_complex*) fftw_malloc(sizeof(fftw_complex)*dm);rn out=(fftw_complex*) fftw_malloc(sizeof(fftw_complex)*dm);rn plan=fftw_plan_dft_1d(dm,in,out,FFTW_FORWARD,FFTW_ESTIMATE);rn rnrnrn for(count=1;count<=p;count++)rn rn lambda=4-cos(p*PI/(m+1));rn rn **in=0;*(*in+1)=0;rn for(count1=1;count1<=m;count1++)rn rn in++;rn **in=temp[count-1][count1-1];rn *(*in+1)=0;rn rn for(count1=1;count1<=m-1;count1++)rn rn in++;rn **in=0;rn *(*in+1)=0;rn rn in=in-m;rnrn fftw_execute(plan);rnrnrn for(count1=1;count1<=m;count1++)rn rn out++;rn data_out_b[count1-1]=(**out);rn rn out=out-m;rn rnrn tridag(u,data_out_b,lambda,m);rnrnrnrn for(count1=1;count1<=m;count1++)rn rn in++;rn **in=u[count1-1];rn *(*in+1)=0;rn rnrnrnrnrn fftw_execute(plan);rnrnrnrnrn for(count1=1;count1<=m;count1++)rn rn out++;rn temp[count-1][count1-1]=(**out);rn rn rn int countm,countp;rn for(countp=1;countp<=p;countp++)rn rn for(countm=1;countm<=m;countm++)rn rn cout< 论坛

没有更多推荐了,返回首页