本文讲的方案实现以下功能:利用winscp和putty的脚本功能,实现在Window平台上编写代码,上传到Linux进行编译,然后取编译结果。需要用到3个文件,分别如下:

(1) synchronize.bat
----------------------------------------
:: 需要更改 WinSCP.exe 和  putty.exe 的路径
:: 需要设置的变量
@SET localpath=E:\work\projectname
@SET remotepath=/home/username/work/projectname
@SET server=192.168.1.168
@SET port=22
@SET username=username
@SET password=123456
@SET winscp="D:\Program Files\WinSCP\WinSCP.exe"
@SET putty="D:\Program Files\WinSCP\PuTTY\putty.exe"

:: 发生文件到linux机器 【LINUX公社 www.LinuxIDC.com 】
%winscp% /console /script=synchronize.script /parameter %username% %password% %server% %port% %localpath% %remotepath%

echo "Send Done!"

:: 创建make shell
echo cd %remotepath% > make.sh
:: echo make clean >> make.sh
echo make 1^>make.out 2^>make.out >> make.sh

:: 执行make
%putty% -pw %password% %username%@%server% -P %port% -m make.sh

echo "Make Done!"

:: 把make的结果传递到客户端
%winscp% /console /script=aftermake.script /parameter %username% %password% %server% %port% %localpath% %remotepath%

:: 显示make后的结果
cat make.out

pause

http://www.bkjia.com/gjrj/800041.html

利用Winscp,Putty实现Windows下编写Linux程序的更多相关文章

  1. 闲来瞎扯 -- 在vs2008下编写linux程序

    虽说vim很强大,但是个人感觉器代码提示功能不如visual assist来的强大.如何使用visual assist来实现代码的提示功能呢? 首先说明我的环境 : 宿主机是xp(O(∩_∩)O~还是 ...

  2. Ubuntu上安装和使用SSH,Xming+PuTTY在Windows下远程Linux主机使用图形界面的程序

    自:http://blog.csdn.net/neofung/article/details/6574002 Ubuntu上安装和使用SSH  网上有很多介绍在Ubuntu下开启SSH服务的文章,但大 ...

  3. Xming + PuTTY 在Windows下远程Linux主机

    Xming + PuTTY 在Windows下远程Linux主机 一.原理     Linux/Unix的X Window具有网络透明性.X Window系统里有一个统一的Server来负责各个程序与 ...

  4. # 如何在Windows下运行Linux程序

    如何在Windows下运行Linux程序 一.搭建 Linux 环境 1.1 安装 VMware Workstation https://www.aliyundrive.com/s/TvuMyFdTs ...

  5. gcc和MinGW的异同(在cygwin/gcc做的东西可以无缝的用在linux下,没有任何问题,是在windows下开发linux程序的一个很好的选择)

    cygwin/gcc和MinGW都是gcc在windows下的编译环境,但是它们有什么区别,在实际工作中如何选择这两种编译器. cygwin/gcc完全可以和在linux下的gcc化做等号,这个可以从 ...

  6. [技术博客] 利用Vagrant+virtualbox在windows下进行linux开发

    目录 加速box安装的方法 root账户登录 换源教程 安装rvm 访问rails server RubyMine连接虚拟机上的解释器 作者:庄廓然 在windows下进行linux开发:利用Vagr ...

  7. 转:Xming + PuTTY 在Windows下远程Linux主机使用图形界面的程序

    一.原理Linux/Unix的X Window具有网络透明性.X Window系统里有一个统一的Server来负责各个程序与显示器.键盘和鼠标等输入输出设备的交互,每个有GUI的应用程序都通过网络协议 ...

  8. Xming + PuTTY 在Windows下远程Linux主机使用图形界面的程序

    安装X Window yum groupinstall 'X Window System'

  9. Golang在windows下交叉编译linux程序

    1.下载相关程序. Golang下载:http://www.golangtc.com/download Git下载:http://git-scm.com/download/ TDM-GCC下载:htt ...

随机推荐

  1. python--data type

    1.Python中常见的数据类型有: 数据类型    内建函数 整型    int(),long() 浮点型    float() 字符串型    str() 列表    list() 元组    t ...

  2. 转:JS线程和JS阻塞页面加载的问题

    前几日写了一篇文章,介绍了js阻塞页面加载的问题.当时是通过例子来验证的.今天,我介绍一下浏览器内核,从原理上介绍一下js阻塞页面加载的原因. 浏览器的内核是多线程的,它们在内核制控下相互配合以保持同 ...

  3. hibernate 单元测试 5.2

     单元测试 测试 dao service action package com.kaishengit.test; import org.hibernate.Session; import com.ka ...

  4. HDU_1003Max Sum 简单动归

    以前做过这道题目,那是还不懂状态方程.乱搞一气: #include<cstdio> #include<algorithm> using namespace std; +; in ...

  5. android错误之android.content.res.Resources$NotFoundException:

    错误:android.content.res.Resources$NotFoundException: String resource ID #0x1 原因:一般发生在参数 int resId 错误, ...

  6. 文件队列 QueueFile

    /** * Copyright (C) 2010 Square, Inc. * * Licensed under the Apache License, Version 2.0 (the " ...

  7. android-改进&lt;&lt;仿QQ&gt;&gt;框架源代码

    该文章主要改动于CSDN某大神的一篇文章,本人认为这篇文章的面向对象非常透彻,以下分享例如以下可学习的几点: Android应用经典主界面框架之中的一个:仿QQ (使用Fragment, 附源代码) ...

  8. 【Web】java date 到 Oracle date 精确到时分秒

    有两种方法: java.util.Date startTime=new Date("2014/01/01 23:00:00"); 1.new Timestamp(startTime ...

  9. 【Android】ScrollView+GridView 显示问题

    在使用Android的ScrollView里面嵌套GridView时,设置android:layout_height="wrap_content"属性,运行界面的效果不会出现全部数 ...

  10. CentOS的MySQL报错:Can't connect to MySQL server

    原文链接: http://www.centoscn.com/CentosBug/softbug/2015/0622/5709.html 问题描述: 使用客户端远程登录连接基于CentOS 6.5服务器 ...