1. scp拷贝文件失败问题

  当在 shell startup script (比如 profile , bashrc)自动执行过程中产生了任何内容输出时, scp / sftp会把这些 echo 回来的东西认作协议包进行解析,结果自然是无法读懂这些内容,最终导致文件拷贝失败。

如果能够明确知道在自己的 /etc/bashrc 等文件里面哪些语句会产生 echo 的内容的话,可以通过条件判断进行 echo :

if [ $(expr index "$-" i) -ne 0 ]; then
    echo "welcome to shell , Now: "
    date +'%Y-%m-%d %T'
fi

这样只有在真正交互登录的时候才会 echo 信息, scp 的时候自动忽略。

http://www.zeali.net/entry/540

2.

Linux使用常见错误集锦的更多相关文章

  1. (转)Hadoop之常见错误集锦

     Hadoop之常见错误集锦            下文中没有特殊说明,环境都是CentOS下Hadoop 2.2.0.1.伪分布模式下执行start-dfs.sh脚本启动HDFS时出现如下错误:   ...

  2. Python:常见错误集锦(持续更新ing)

    初学Python,很容易与各种错误不断的遭遇.通过集锦,可以快速的找到错误的原因和解决方法. 1.IndentationError:expected an indented block 说明此处需要缩 ...

  3. hadoop常见错误集锦

    1  Hadoop namenode -format后Incompatible namespaceIDS 错误解决办法 重新格式话namenode后,会重新分配一个namespaceId, 这个nam ...

  4. linux之常见错误

    在日常开发中,尤其是在Linux中进行操作的时候,经常会碰到各种各样的错误.记录一下,熟能生巧,慢慢参透linux的奥秘 1) 在安装ssl证书的时候,发生certbot命令无法使用的情况 解决方案: ...

  5. linux内核编译错误集锦

    1,我是用的ubuntu16.04 32位系统编译内核linux-3.0.1出现如下错误:Can't use 'defined(@array)' (Maybe you should just omit ...

  6. ubuntu安装php常见错误集锦

    一.configure 报错 1.错误类型: Configure: error: Please reinstall the libcurl distribution-easy.h should be ...

  7. Oracle常见错误集锦

    1.ORA-12560:TNS:协议适配器错误 OracleService<SID>服务没有启动 2. ORA-12541:TNS:无监听程序 Oracle<ORACLE_HOME& ...

  8. 和菜鸟一起学linux之常见错误的解决和常用命令

    1.错误提示:make:警告:检测到时钟错误.您的创建可能是不完整的. 解决方法:当前编译目录下,命令行输入:find . -type f -exec touch {} \; 2.SSH生成密钥:ss ...

  9. Sliverlight常见错误集锦

    1. 使用GridSplitter时候(参考),出现如下错误 C# 中的错误Error 2 The type 'sp:GridSplitter' was not found. Verify…… 对程序 ...

随机推荐

  1. 204. Count Primes

    Description: Count the number of prime numbers less than a non-negative number, n. ============= 找质数 ...

  2. Akka(二) - Future

    1. future的所有方法都是非阻塞立即返回的 (1)future都要有TimeOut和ExecutionContextExecutor这2个隐士参数 (2)打印future object Hell ...

  3. could not open extension control file "/usr/share/postgresql/9.1/extension/plpythonu.control": No such file or directory

    在使用createlang 安装plpythonu的时候出现如下错误:could not open extension control file "/usr/share/postgresql ...

  4. [Serializable]的应用--注册码的生成,加密和验证

    1.首先定义注册类RegisterEntity [Serializable] public class RegisterEntity { public string RegisterKey; publ ...

  5. 在C#中子线程如何操作主线程中窗体上控件

    在C#中,直接在子线程中对窗体上的控件操作是会出现异常,这是由于子线程和运行窗体的线程是不同的空间,因此想要在子线程来操作窗体上的控件,是不可能 简单的通过控件对象名来操作,但不是说不能进行操作,微软 ...

  6. Shell_Shell调用SQLPlus简介(案例)

    2014-06-20  Created By BaoXinjian

  7. CF 501C Misha and Forest 好题

    C. Misha and Forest   Let's define a forest as a non-directed acyclic graph (also without loops and ...

  8. Configuration problem: Only one AsyncAnnotationBeanPostProcessor may exist within the context.

    去配置文件中找 , 某个配置文件被引用了两次以上.移除后保留一个即可.如下即可产生上述问题 <import resource="classpath:testContext-curren ...

  9. MYSQL批量插入数据库实现语句性能分析

    假定我们的表结构如下 代码如下   CREATE TABLE example ( example_id INT NOT NULL, name VARCHAR( 50 ) NOT NULL, value ...

  10. block作为类的属性时用copy

    1. block作为类的属性时用copy Block属性的声明,首先需要用copy修饰符,因为只有copy后的Block才会在堆中,栈中的Block的生命周期是和栈绑定的 <栈 :由系统维护的局 ...