0

Thanks in advance:

I'm attempting to use Notepad++ to log-in to a UNIX system. I am using the NPPExec console to do this, and the login process works... kind of. I use NPPExec to execute this script, named "sasunix.sh":

"C:\userblah\username\Desktop\plink.exe" -load "SUN4" -l myloginname -pw mypassword

As you can see I am using Putty's command line program "plink.exe" to send the command; "SUN4" is the session profile I am using. The problem is, the next screen logs me in (successfully), but proceeds to ask me for my password an additional time (which is part of the login procedure), followed by a request for my my terminal emulation setting (for me, this is 'xterm').

THE QUESTION: What additional lines would I add to my script to execute this sequence of inputs on the UNIX system (i.e. typing them in individually and pressing "ENTER" each time):

1.) thepassword 2.) xterm 3.) sas -nodms -nonews

I think this boils down to a misunderstanding of how commands are passed between NotePad++ and the NPPExec console window. At any point, if I press "F6", a prompt pops up, saying "WARNING: Console process still running...". This messagebox prompt allows me to type in a line which is then sent to the console... but how do I put a series of these inputs into the script?

4

1 に答える 1

0

あなたはおそらくこれで解決しましたが、私は次のことを行いました

  1. ディレクトリ パスに基づいて、UNIX コマンドでファイルを作成する Windows バッチ スクリプト

    @ECHO OFF
    
    :: store input variable
    
    set str=%1
    
    :: remove C:\ or Z:\ etc
    
    set str=%str:~3%
    
    :: replace \ with /
    
    set str=%str:\=/%
    
    :: append cd command
    
    set str1=cd
    
    set str=%str1% %str%
    
    echo.%str%
    
    :: make
    
    echo make clean
    
    echo make all
    
  2. NppExec プラグインを Notepad++ にインストールする

  3. *.bat スクリプトと plink.exe を Notepad++ プログラム ディレクトリに配置します。

  4. NppExec コマンドを作成する

    // This line calls the bat file and creates a file tempcmd.sh with unix commands in it
    "$(NPP_DIRECTORY)\unix_make_all.bat" $(CURRENT_DIRECTORY) >tempcmd.sh`
    
    
     // This line connects to a remote machine and runs all the commands stored in tempcmd.sh
     "$(NPP_DIRECTORY)\plink.exe" -ssh -2 -l username -pw password 192.168.000.000 -m "$(NPP_DIRECTORY)\tempcmd.sh"
    
  5. NppExecオプションを使用して、上記のコマンドを保存し、マクロメニューにショートカットを配置します

于 2013-05-22T10:19:12.777 に答える