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. LAMP——实现phpMyadmin、wordpress及Discuz应用部署

    一.环境准备 操作系统:Centos8.3.2011 软件:Apache2.4.37.Mysql8.0.21.PHP7.2.24 二.安装过程 1.安装phpmyadmin 1.1.安装软件包并启动服 ...

  2. AcWing 106. 动态中位数

    依次读入一个整数序列,每当已经读入的整数个数为奇数时,输出已读入的整数构成的序列的中位数. #include<bits/stdc++.h> using namespace std; pri ...

  3. CentOS-配置JDK(压缩包)

    卸载openjdk $ rpm -qa | grep jdk 以上命令用来检查linux上是否安装openjdk,如果安装需要将其全部卸载掉,卸载命令: $ rpm -e --nodeps java- ...

  4. gitolite安装及配置

    1.客户端(1)使用ssh-keygen命令在当前用户根目录下生成密钥(2)将该密钥远程拷贝到gitserver服务器上:scp ~/.ssh/id_rsa.pub user@ip:/tmp/neu. ...

  5. ESP32省电模式连接WIFI笔记

    基于ESP-IDF4.1版本 main.c文件如下: #include <string.h> #include "freertos/FreeRTOS.h" #inclu ...

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

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

  7. iOS基于AVFoundation实现朗读文字

    iOS基于AVFoundation实现朗读文字 1.心理建设 众所周知AVFoundation的朗读是个智障语气,所以想不花钱就只能忍着. 2.speechManager @import AVFoun ...

  8. 使用Nginx将请求转发至Google Analytics实现后端数据统计

    前言 Google Analytics 加载缓慢是本博客在国内访问缓慢的原因之一.虽然通过使用大公司的 ga.js 的 CDN ,可以很大程度上加快加载 ga.js 文件的速度( ga.js 的更新频 ...

  9. clickhouse分布式集群

    一.环境准备: 主机 系统 应用 ip ckh-01 centos 8 jdk,zookeeper,clickhouse 192.168.205.190 ckh-02 centos 8 jdk,zoo ...

  10. ES 基础知识点总结

    为什么使用 ES? 在传统的数据库中,如果使用某列记录某件商品的标题或简介.在检索时要想使用关键词来查询某个记录,那么是很困难的,假设搜索关键词 "小米",那么 sql 语句就是 ...