1.文件上传
curl http://39.106.212.106/Demo/upload_file.php -F "file=@/Users/shijianmei/Downloads/erweima1.png" -F "version=123456789" -v
2.把shell 执行结果赋值给变量:
- 用
,(尖号)把命令括起来,然后赋值给变量
dir=`pwd`
- 采用 变量=$(pwd)
dir=$(pwd)
3.如果目录下的文件夹不存在,则创建
dirname="${export_path}/manifest"
echo "the dir name is $dirname"
if [ ! -d $dirname ];then
mkdir -p $dirname#-p表示支持多级目录
else
echo manifest exist
fi
4.写文件到目录下
mainfestPlistPath="a/manifest.plist"
cat << EOF > ${mainfestPlistPath}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>items</key>
<array>
<dict>
<key>assets</key>
<array>
<dict>
<key>kind</key>
<string>software-package</string>
<key>url</key>
<string></string>
</dict>
<dict>
<key>kind</key>
<string>display-image</string>
<key>url</key>
<string></string>
</dict>
<dict>
<key>kind</key>
<string>full-size-image</string>
<key>url</key>
<string></string>
</dict>
</array>
<key>metadata</key>
<dict>
<key>bundle-identifier</key>
<string>com.ucarinc.xxx</string>
<key>bundle-version</key>
<string>2.0.0</string>
<key>kind</key>
<string>software</string>
<key>title</key>
<string>MMCApp</string>
</dict>
</dict>
</array>
</dict>
</plist>
EOF=
5.上传文件夹到linux
scp -r 1822555_bao.mmcbao.cn_apache/ root@39.106.212.106:/etc/httpd
scp -r 1822555_bao.mmcbao.cn_apache/a.mp3 root@39.106.212.106:/etc/httpd
6.从 远程linux服务器 复制到 本地
scp root@www.cumt.edu.cn:/home/root/others/music /home/space/music/1.mp3
scp -r www.cumt.edu.cn:/home/root/others/ /home/space/music/
网友评论