The following script auto login to server 49, send 2 commands and exit from the server.

  1. Create a automation script named "auto.sh":

echo "open 10.0.2.49 -l gcp"
sleep 2
echo "gcp"
sleep 1
echo "ls"
sleep 1
echo "pwd"
sleep 3

echo "hadoop fs -put /home/boco/gdpp/91/ hdfs://cloud216:8020/user/boco/gsp/yyyy > mylog"

sleep 3
echo "exit"

  1. Make the script executable: chmod 755 auto.sh;

  2. $ ./auto.sh|telnet

Ref: http://stackoverflow.com/questions/7013137/automating-telnet-session-using-bash-scripts

Semi-automation Script Based on Sleep的更多相关文章

  1. Automation Script For Percona Xtrabackup FULL/Incremental

    This is my first post in 2019, and Im starting with a MySQL solution. In MySQL world, implementing a ...

  2. Automation Testing - Best Practice(书写规范)

    Coding Standards Coding Standards are suggestions that will help us to write automation Scripts code ...

  3. BlackArch-Tools

    BlackArch-Tools 简介 安装在ArchLinux之上添加存储库从blackarch存储库安装工具替代安装方法BlackArch Linux Complete Tools List 简介 ...

  4. VCAP5-DCA – What’s new?

    see also: 韩国人的教材:http://ddii.pe.kr/ Section 1.1 – Implement and Manage complex storage Determine use ...

  5. Expect Command And How To Automate Shell Scripts Like Magic

    In the previous post, we talked about writing practical shell scripts and we saw how it is easy to w ...

  6. pdf 中内容的坐标系

    PDF Page Coordinates (page size, field placement, etc.) AcroForm, Basics, Automation Page coordinate ...

  7. Linux Expect自动交互脚本

    https://likegeeks.com/expect-command/ In the previous post, we talked about writing practical shell ...

  8. splash-简介及入门

    splash 1.      splash简介 Splash是一个JavaScript渲染服务,是一个带有HTTP API的轻量级浏览器,同时它对接了Python中的Twisted和QT库.利用它,我 ...

  9. MySQL集群搭建(5)-MHA高可用架构

    1 概述 1.1 MHA 简介 MHA - Master High Availability 是由 Perl 实现的一款高可用程序,出现故障时,MHA 以最小的停机时间(通常10-30秒)执行 mas ...

随机推荐

  1. sonarqube 8.9版本配置项目访问权限

    soanrqube设置项目权限 admin->项目->要设置的项目 进行项目权限配置 选择权限 权限配置(公开,私有)如果是公司项目建议选择私有 根据项目团队成员的角色需求,进行勾选配置 ...

  2. Html:id,name,class之间的有什么区别?

    name 一个name可以同时对应多个控件,比如checkbox和radio,主要用于获取提交表单的某表单域信息, 作为可与服务器交互数据的HTML元素的服务器端的标示,比如input.select. ...

  3. WPF教程四:字段、属性、依赖项属性的演变过程

    这个章节主要讲解属性是什么,为什么会演变出依赖项属性,依赖属性的优势是什么.以及如何更好的使用属性和依赖项属性. 一.属性 属性是什么. 翻了好几本C#的书和微软的文档,我觉得对属性讲解比较好理解的就 ...

  4. python 字符串 增、删、改、查基本操作

    private static String TAG = "MainActivity"; private String str = " a,bB,1cCcc,2dDd d2 ...

  5. 【故障公告】redis 服务器宕机引发博客站点故障

    非常抱歉,今天下午 17:10~17:40 左右,由于博客系统所使用的 redis 服务器宕机,造成博客站点无法正常访问,由此给您带来很大的麻烦,请您谅解. 我们会针对这次故障改进 redis 服务器 ...

  6. 长按短按控制LED灯-ESP32中断处理

    #include <stdio.h> #include <string.h> #include <stdlib.h> #include "freertos ...

  7. 从零开始给女朋友讲计算机 1 - 从比特、字节、补码到 ASCII、GB2312、Unicode

    起因 在代码 review 的过程中,总是发现有人在数据类型转换(reinterpret_cast).大小端的问题(什么情况下需要考虑大小端,什么情况下不需要考虑)上犯错误,究其原因是没有彻彻底底地搞 ...

  8. python04篇 文件操作(二)、集合

    一.文件操作(二) 1.1 利用with来打开文件 # with open ,python 会自动关闭文件 with open('a.txt', encoding='utf-8') as f: # f ...

  9. 使用 VSCode 搭建 Flutter环境

    概述 编辑器使用 vscode,不再安装 Android Studio. 安装 Git 点击这里 下载并安装 Git 配置 Java 环境 下载和安装 JDK 点击下载 Java SE Develop ...

  10. lucene 入门简介

    Lucene 是一个基于 Java 的全文信息检索工具包,它不是一个完整的搜索应用程序,而是为你的应用程序提供索引和搜索功能.Lucene 目前是 Apache Jakarta 家族中的一个开源项目. ...