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. IDEA详细配置+优秀插件

    目录 IDEA破解 Settings配置 配置 settings 字体 关闭IDEA更新 设置IDEA打开为项目选择界面 自动导入包配置 显示方法的分割线 滚轮设置字体大小 智能提示忽略大小写 Tab ...

  2. 创建Maven项目骨架并使用

    1.archetype是什么? archetype 字面意思是 原型.可以理解为archetype相当于一个脚手架/模板,通过这个脚手架/模板我们可以快速的创建出一个项目. 比如下图中的这些就是mav ...

  3. Linux(CentOS)下安装docker

    Linux(CentOS)安装Docker 查看当前内核版本 [docker@localhost ~]$ uname -r 确保yum包更新到最新 [docker@localhost ~]$ sudo ...

  4. hugegraph 源码解读 —— 索引与查询优化分析

    为什么要有索引 gremlin 其实是一个逐级过滤的运行机制,比如下面的一个简单的gremlin查询语句: g.V().hasLabel("label").has("pr ...

  5. 打通“任督二脉”:Android 应用安装优化实战

    疑问: (1)了解APK安装流程有什么好处 (2)了解APK安装流程可以解决什么问题 一.可以在安装流程里做什么 安装就分为下面三个阶段,每个阶段可以做些什么工作,可以帮助我们优化安装流程,解决安装后 ...

  6. 资源:Postgresql数据库下载路径

    postgresql下载路径: https://www.enterprisedb.com/downloads/postgres-postgresql-downloads

  7. JS秒表倒计时器 (转)

    <html> <body> <span>倒计时30分钟:</span><span id="clock">00:30:00 ...

  8. 『心善渊』Selenium3.0基础 — 26、unittest测试框架的断言

    目录 1.断言介绍 2.常用的断言方法 3.断言示例 1.断言介绍 在执行测试用例的过程中,最终用例是否执行通过,是通过判断测试得到的实际结果和预期结果是否相等决定的,这时会用到断言方法. 本着没有消 ...

  9. 「CF986F」 Oppa Funcan Style Remastered

    「CF986F」 Oppa Funcan Style Remastered Link 首先发现分解成若干个 \(k\) 的因数很蠢,事实上每个因数都是由某个质因子的若干倍组成的,所以可以将问题转换为分 ...

  10. C语言:转义字符 ++a例子

    #include <stdio.h> int main() { printf("a\bwhat\'s\tyour\tname\n"); int k; printf(&q ...