嗨,我有一些文件路径,如/ ifshk5/BC_IP/PROJECT/T1 1073/T11073_RICljiR/split/AG19_235/120225_I872_FCC0HN2ACXX_L8_RICljiRSYHSD2-1-IP AAPEK-17_1.fq.gz
我需要从一个ftp服务器复制文件到其他服务器.如果服务器中不存在,还需要创建目录.我登录包含这些文件的服务器然后运行此代码
#! /bin/bash
while read myline
do
for i in $myline
do
if [ -f $i ]
then
location=$(echo "$i" | awk -F "/" '{ print "", $6, $7, $8 }' OFS="/")
#location shows /T11073_RICekkR/Fq/AS59_59304
location="/opt/CLiMB/Storage3/ftp/ftp_climb/100033"$location
echo $location
ssh tam@192.168.174.43 mkdir -p $location
scp -r $i tam@192.168.174.43:$location
fi
done
done < /ifshk5/BC_IP/PROJECT/T11073/T11073_all_3254.fq.list
Run Code Online (Sandbox Code Playgroud)
它有一些问题,1.它无法工作总是显示权限被拒绝,请再试一次.但当我直接打字
ssh tam@192.168.174.43 mkdir -p /sample/xxxx
Run Code Online (Sandbox Code Playgroud)
它可以工作,新的目录位置是正确的,它显示如/ opt/CLiMB/Storage3/ftp/ftp_climb/100033/T11073_RICekkR/Fq/AS59_59304
我正在尝试开发一个使用iPhone的GPS和指南针的应用程序,以指向某个特定位置的指针(就像指南针总是指向北方).位置是固定的,无论用户位于何处,我总是需要指针指向该特定位置.我有这个位置的Lat/Long坐标,但不知道如何使用指南针和GPS指向该位置...就像http://www.youtube.com/watch?v=iC0Xn8hY80w此链接1: 20'
我写了一些代码,然而,它无法正确旋转方向.
-(float) angleToRadians:(double) a {
return ((a/180)*M_PI);
}
-(void)updateArrow {
double alon=[longi doubleValue];//source
double alat=[lati doubleValue];//source
double blon=[pointlongi doubleValue];//destination
double blat=[pointlati doubleValue];//destination
float fLat = [self angleToRadians:alat];
float fLng = [self angleToRadians:alon];
float tLat = [self angleToRadians:blat];
float tLng = [self angleToRadians:blon];
float temp = atan2(sin(tLng-fLng)*cos(tLat),
cos(fLat)*sin(tLat)-sin(fLat)*cos(tLat)*cos(tLng-fLng));
double temp2= previousHeading;
double temp1=temp-[self angleToRadians:temp2];
/*I using this,but it can't rotate by :point even i change the coordinate
in CGPointMake */
Compass2.layer.anchorPoint=CGPointMake(0, 0.5);
[Compass2 setTransform:CGAffineTransformMakeRotation(temp1)];
/* Compass2 is …Run Code Online (Sandbox Code Playgroud)