0
votes

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?

1

1 Answers

0
votes

You prob have this solved by now, but i have done the following

  1. a windows batch script that creates a file with unix commands, based on the a directory path

    @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. Install the NppExec plugin to Notepad++

  3. Place the *.bat scripts and plink.exe in the Notepad++ program directory

  4. Create the NppExec commands

    // 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. Using the NppExec options i save the above commands and place a shortcut in the macros menu