rm -rf `find . -name "*.example"`
Xcode出包报错User interaction is not allowed,解决方案
shell脚本调用Xcode打包时会遇到这个错误,个人感觉应该是权限的问题,网上找到有人遇到类似问题,他的解决方案如下 原帖地址
- 打开Keychain Access,中文叫钥匙串访问权限
- 找到你的证书,右击 — 显示简介 — 访问控制 — 选中【允许所有应用程序访问此项目】 — 存储更攺 — 输入密码后保存更攺,解决问题。
允许所有应用程序访问此项目我在Xcode7版本没找到这个 允许所有应用程序访问此项目
.自己摸索了下, 在信任里找到使用此证书时, 选择始终信任 ,问题解决了.
钥匙串访问(Keychain Access)是一个Mac OS X应用程序,它允许用户访问和配置钥匙串的内容(包括网站,FTP服务器,SSH帐户,网络共享,无线网络,群组软件,加密磁盘映像等内容的密码等),加锁或解锁钥匙串,显示系统存储的密码,管理根证书,密钥和加密笔记。
Windows脚本 - %~dp0的含义(转)
更改当前目录为批处理本身的目录
有些晕吧?不急,我举例
比如你有个批处理a.bat在D:\qq文件夹下
a.bat内容为
cd /d %~dp0
在这里
cd /d %~dp0的意思就是cd /d d:\qq
%0代表批处理本身 d:\qq\a.bat
~dp是变量扩充
d既是扩充到分区号 d:
p就是扩充到路径 \qq
dp就是扩充到分区号路径 d:\qq
扩充变量语法详解:
:: 选项语法:
:: ~I - 删除任何引号("),扩充 %I
:: %~fI - 将 %I 扩充到一个完全合格的路径名
:: %~dI - 仅将 %I 扩充到一个驱动器号
:: %~pI - 仅将 %I 扩充到一个路径
:: %~nI - 仅将 %I 扩充到一个文件名
:: %~xI - 仅将 %I 扩充到一个文件扩展名
:: %~sI - 扩充的路径只含有短名
:: %~aI - 将 %I 扩充到文件的文件属性
:: %~tI - 将 %I 扩充到文件的日期/时间
:: %~zI - 将 %I 扩充到文件的大小
:: %~$PATH:I - 查找列在路径环境变量的目录,并将 %I 扩充
:: 到找到的第一个完全合格的名称。如果环境变量名
:: 未被定义,或者没有找到文件,此组合键会扩充到
:: 空字符串
:: 可以组合修饰符来得到多重结果:
:: %~dpI - 仅将 %I 扩充到一个驱动器号和路径
:: %~nxI - 仅将 %I 扩充到一个文件名和扩展名
:: %~fsI - 仅将 %I 扩充到一个带有短名的完整路径名
:: %~dp$PATH:i - 查找列在路径环境变量的目录,并将 %I 扩充
:: 到找到的第一个驱动器号和路径。
:: %~ftzaI - 将 %I 扩充到类似输出线路的 DIR
http://www.911cd.net/forums/lofiversion/index.php/t3730.html Look at this: Manipulating variables in CMD shell I'm not sure why this type of information isn't more prominent in the help files, but there you go. NT's command shell can manipulate variables but the operations you can perform are fairly limited. Still, better than nothing. :-) If you want to do some really clever stuff then you're going to have to look elsewhere. Vbscript can be useful as it's got lots of string handling capabilities. There's also Perl and AWK which are Windows (windoze?) ports of some very powerful Unix commands.
%1 is your command line option.
Namely: mycommand.cmd myoption1.
%0 determins where the batch file is running from. I've created a demo batch file in my winnt system32 folder called x.cmd. Running this gives the results shown below
%~f1 expands %1 to the drive, path and file name. If you pass %1 from the current directory then this expands that variable to it's full path
echo f0 = %~f0 produces f0 = c:\WINNT\system32\x.cmd %~d1 gets the drive letter from %1 echo d0 = %~d0 produces d0 = D %~p1 extracts the path from variable %1 echo p0 = %~p0 produces \WINNT\system32\ %~dp1 pulls the drive letter and path echo dp0 = %~dp0 produces C:\WINNT\system32\ %~sp1 creates a short path (but no drive letter)
echo sp0 = %~sp0 produces \WINNT\system32
If I set %1 to "c:\Program Files\Internet Explorer" then %~sp1 produces \PROGRA~1\INTER. Note you have to wrap the long path in quotes otherwise the truncation doesn't work. %~x1 leaves only the command extension echo x0 = %~x0 produces .cmd %~nx1 extracts the file name and extension echo nx0 = %~nx0 produces x.cmd %~sx1 extracts the short extension from %0 echo sx0 = %~sx0 produces .cmd but a longer extension (.document?) would be cut down to .doc
%~dp0 VS %cd% http://www.computerhope.com/forum/index.php?topic=54333.0 %cd% is available either to a batch file or at the command prompt and expands to the drive letter and path of the current directory (which can change e.g. by using the CD command)
%~dp0 is only available within a batch file and expands to the drive letter and path in which that batch file is located (which cannot change). It is obtained from %0 which is the batch file's name.
An experiment like the following shows the difference
Here is D:\dirshow.bat:
Code: @echo off echo this is %%cd%% %cd% echo this is %%~dp0 %~dp0
Run it from C:\ and this is what you see Code: C:>D:\dirshow.bat this is %cd% C:\ this is %~dp0 D:\
Screen使用教程(转)
1、常用的使用方法
1.1 创建screen会话
可以先执行:screen -S lnmp ,screen就会创建一个名字为lnmp的会话。
1.2 暂时离开,保留screen会话中的任务或程序
当需要临时离开时(会话中的程序不会关闭,仍在运行)可以用快捷键Ctrl+a d(即按住Ctrl,依次再按a,d)
1.3 恢复screen会话
当回来时可以再执行执行:screen -r lnmp 即可恢复到离开前创建的lnmp会话的工作界面。如果忘记了,或者当时没有指定会话名,可以执行:screen -ls screen会列出当前存在的会话列表,如下图:
11791.lnmp即为刚才的screen创建的lnmp会话,目前已经暂时退出了lnmp会话,所以状态为Detached,当使用screen -r lnmp后状态就会变为Attached,11791是这个screen的会话的进程ID,恢复会话时也可以使用:screen -r 11791
1.4 关闭screen的会话
执行:exit ,会提示:[screen is terminating],表示已经成功退出screen会话。
2、远程演示
首先演示者先在服务器上执行 screen -S test 创建一个screen会话,观众可以链接到远程服务器上执行screen -x test 观众屏幕上就会出现和演示者同步。
3、常用快捷键
- Ctrl+a c :在当前screen会话中创建窗口
- Ctrl+a w :窗口列表
- Ctrl+a n :下一个窗口
- Ctrl+a p :上一个窗口
- Ctrl+a 0-9 :在第0个窗口和第9个窗口之间切换
用Putty实现Linux与Windows互传文件
用Putty实现Linux与Windows互传文件
一般Linux与Windows大都使用FTP或者wget之类的工具来传输文件,Linux与Linux之间互传文件则使用scp工具。
scp(secure copy)确实是个好东西,用于在Linux下进行远程拷贝文件的命令,和它类似的命令有cp,不过cp只是在本机进行拷贝不能跨服务器,而且scp传输是加密的:
本地上传文件至服务器:
scp 本地文件名 远程用户名@远程IP地址:路径/新文件名;
例:scp AA.zip test@200.100.0.1:www/AA_new.zip;
从远程服务器下载文件至本地:
scp 远程用户名@远程IP地址:路径/新文件名 本地文件名;
例:scp test@200.100.0.1:www/AA.zip AA_new.zip;
这对于linux与linux之间互传是非常方便的。
如果从一台Windows机器要传输数据到一台仅开SSH服务的Linux服务器时,pscp就要发挥威力了。
PSCP和SCP功能相同,是putty的一个附加程序,一般在putty的目录下可以找到。pscp.exe只有一个文件,(将pscp.exe放到C:\WINDOWS\system32下就能直接在命令行下使用pscp命令了)。语法与scp相同,下面是几个有用的options。
pscp [options] source [source…] [user@]host:target
-p 拷贝文件的时候保留源文件建立的时间。 -q 执行文件拷贝时,不显示任何提示消息。 -r 拷贝整个目录 -v 拷贝文件时,显示提示信息。 例如我要将windows上的一个zip包通过SSH服务传输到Linux服务器上可以这样做:
D:PROGRA~1Putty>pscp -pw mypasswd “E:/TDDOWNLOAD/Discuz!_6.0.0_SC_GBK.zip” Holmesian@192.168.128.128:. Discuz!_6.0.0_SC_GBK.zip | 3711 kB | 1855.6 kB/s | ETA: 00:00:00 | 100% 相应的从Linux服务器上下载文件只需要将目标和源反过来即可。