Sending commands through Telnet - possible to get return code?

I have gotten a little program working that will telnet to another server and run commands using Jakarta Commons net (which underneath it all uses a socket). I was wondering if I run a perl script remotely on the other machine, and the perl script returns a code (0, 1, etc) , is it possible to capture that return code? So far it is just sending commands back and forth through text...

Write yourself a script that invokes those commands and either echo's the exit code to the command line or saves the exit codes to a file.

Similar Messages

  • Get return code in command line

    Hi,
    Is possible modify or get return code diferent 0 or 1 when start scenario using command line?

    i use control+M, and result with erros in E$, send to "hospital" whit this

  • Error Getting return code while FTPing file through JAVA

    Hello experts
    My requirement is to send file to Mainframe server in a JOBQ.I used a socket to connect to server. A designated FTP ID is provided for authentication.
    I tried to FTP file to mainframe sever, but while getting return code from server, i m recieving Junk values.I am reading return code through BufferReader.readline().
    I have set up the connection mode to ASCII mode.I tried to set up the connection mode to EBSIDIC mode too, but i revieve the same error.
    Any one have tried to FTP file to mainframe in got the same error.What could be the possible reason.
    Here is the error looks like :-
    Inside SocketClient() class, in connect(String hostname, int port) socket = Socket[addr=xxx.xx.xx.com/xx.xxx.xx.xx,port=21,localport=2500]
    Inside SocketClient() class, in connectAction() method (InputStream) input = java.net.SocketInputStream@696fc610
    Inside SocketClient() class, in connectAction() method (OutputStream) output = java.net.SocketOutputStream@695b8610
    Inside FTP class, in __getReply() method _controlInput = java.io.BufferedReader@15370617
    Inside FTP class, in __getReply() method Line = ��&�&#63641;����(��&����/������<�������<&#63641;��|(?>
    Any help in this topic is appriciated
    Regards
    Samit

    This is the third party API's i have used
    http://www.enterprisedt.com/downloads/ftp.html
    download this.
    Version 1.2.1 (Jan 29, 2003). Download here. (tar.gz format. WinZip will unpack this). Compiled/tested for JDK1.4.x. Will work for 1.3.x etc

  • Difficulty sending photos through iPhoto 11 often get a connection error.  When I go to my email and copy the photos in email the emails go out always with never a problem

    I have difficulty sending photos through iPhoto 11 often get a connection error.  When I go to my email and copy the photos in email the emails go out right away and never seem to have a connection problem?  Why did they cahnge the process for sending photos form iphoto?

    It is an addition option some people like and other do not (I do not)  --  to use it as always is trivial - in the iPhoto preferences set Apple Mail as the e-mail client
    LN

  • Write error. [Error sending mail message to SMTP server. Return code: [].]:

    Hi ,
    I am getting the below error when scheduling a report which is larger in size in excel format.
    write error. [Error sending mail message to SMTP server. Return code: [].]: [CrystalEnterprise.Smtp]  
    The same error does not come up when sending the same report in XLS format using outlook.
    Can some one confirm if this error is because of the size of the report as I see a different error in XIR2 incase the size the exceeds the email server limit.
    ~Neethi

    Hi,
    this could be
    Maybe you have different limits for service smtp account (which the BO Server should use) and User smtp accounts.
    Thats why you can sent it via outlook and not from the BO Server.
    Regards
    -Seb.

  • Error in LSMW getting return code 6

    Hi all,
                 i Am getting a  Error in LSMW getting return code 6 , after asign a file , in the read data step i am getting the error , please help me it is very urgent,
    sridhar

    Hi,
    If the Sy-Subrc is 0 then Success, if the Sy-SUBRC is 4 then failure, if the Sy-SUBRC = 6 then the user might be not access to read the file
    AUTHORITY-CHECK sets SY-SUBRC to 0 if the user has the necessary authorization, otherwise 4, 8, 12, 16, 24, 28, 32, or 36 depending on the cause
    Regards
    Sudheer

  • Is it possible to get source code of AutomationManager.as class or/and QTPAdapter.as?

    Sorry, we don’t really provide source for those classes right now.
    On 2/25/09 2:47 AM, "JabbyPanda" <
    [email protected]> wrote:
    A new discussion was started by JabbyPanda in
    General Discussion --
      Is it possible to get source code of  AutomationManager.as class or/and QTPAdapter.as?
    I have a license of Flex Builder 3.0.1 Pro, running Win XP.
    Inside "c:\Program Files\Adobe\Flex Builder 3 Plug-in\sdks\2.0.1\frameworks\source\mx\automation\"  folder I can only locate a listing of source code of IAutomationManager interface.
    Inside "c:\Program Files\Adobe\Flex Builder 3 Plug-in\sdks\3.2.0\frameworks\projects\automation\src\mx\automation\" folder there is also a bunch of open sourced classes present, but even source code of IAutomationManager interface is missing.
    And source code for AutomationManager.as and QTPAdapter.as classes are nowhere to find.
    And I tried to extract source files from Data Visualization package as suggested here
    http://blogs.adobe.com/flexdoc/2008/04/extracting_data_visualization.html, no luck
    View/reply at Is it possible to get source code of  AutomationManager.as class or/and QTPAdapter.as? <
    http://www.adobeforums.com/webx?13@@.59b80b91>
    Replies by email are OK.
    Use the unsubscribe <
    http://www.adobeforums.com/webx?280@@.59b80b91!folder=.3c060fa1>  form to cancel your email subscription.

    We can look at setting up some subtopic forums targeting specifics like automation once we have our new system in place.
    On 2/26/09 7:57 AM, "JabbyPanda" <
    [email protected]> wrote:
    A new message was posted by JabbyPanda in
    General Discussion --
      Is it possible to get source code of AutomationManager.as class or/and QTPAdapter.as?
    What I plan to do, is to write a couple of delegates to prepare (instrument) my custom components that extend from UIComponent for testing.
    I found the source file for AQAdapter.as from FlexMonkey tool at  
    http://code.google.com/p/flexmonkey/source/browse/trunk/FlexMonkey/src/com/gorillalogic/aq adaptor/AQAdapter.as, by studying the code of AQAdapter.as I can get the better idea what QTPAdapter.as does.
    In general, I found the documentation on test automation for Flex application to be very modest and limited, for example many attributes for XML-based "class information file" for HP QuickTest tool are not documented at Adobe Flex livedocs.
    BTW, is there any better place where test professionals and Adobe Flex developers exchange the knowledge on test automation of Flex apps?
    I've tried
    http://www.sqaforums.com by running search query
    http://www.google.com/custom?domains=SQAforums.com&! q=Adobe+Flex&sitesearch=SQAforums.com <
    http://www.google.com/custom?domains=SQAforums.com&q=Adobe+Flex&sitesearch=SQAforums.com> , but I left with a feeling the most enquiries were made by people who are just evaluating possiblity of testing of Flex apps with HP QuickTest tool.  

  • Getting return code as 1 for SD_SHIPMENT_PROCESS_HU

    Hi All,
    Could you please tell me what is the use of SD_SHIPMENT_PROCESS_HU function module.
    I am debugging one standard program in that after processing  this FM in  SD_SHIPMENT_PROCESS Function module getting return code is 1.
    Could you please tell me,what might be the reason.
    Thanks in Advance.
    Regards,
    Rama.

    Hi Rama,
    if you will look into the specified function module
    CALL FUNCTION 'SD_SHIPMENT_PROCESS_HU'
      IMPORTING
        e_logfile =                 " v56e_logfile
      CHANGING
        c_activities =              " v56e_shipment_activities
        c_shipment =                " v56e_shipment
      EXCEPTIONS
        ERROR = 1                   "
    so if you are getting returned code as 1, it means there is any error.

  • Want to use dotNet with teststand, but unsure how to send commands through serial port

    I have a loCom communication dll used to send and recieve commands through serial comunication for a particular product.  I the past they have used a LabVIEW wrapper to send and recieve commands, using this particular dll.  I would like to just use testStand for the DOTNET Dll.  I can get the commands, know the inputs and outputs required, however I can not figure out how to send the commands to the serial port.  Anyone have any exprience doing this in TesSTand?

    hallawt,
    With your .NET code module, you should be able to call it directly, most likely as a parameter in the .NET method.
    What are the inputs for the method you're trying to use?
    Also, could you clarify where you're starting to have problems in your project?
    Regards,
    Renée M
    Applications Engineer
    National Instruments

  • Getting return code from remote script after Unix rsh call

    I hope one of you guys can help me with this issue. I think I've gotten the 'rsh' command to work from the CES application so that the sqr report generation can execute on a remote machine (instead of the app server machine). I'm actually doing this by having the app still execute the ces_sqr script, however, now the ces_sqr script will just have an 'rsh' command in it which will cause the actual real sqr processing to occur remotely.
    I am executing a Unix script which does a remote shell call to another script on a remote machine. The remote script sends a return code when run locally, however, how can I get the calling rsh script to get that return code?
    If I do the following in the rsh script:
    rsh -l resdev morph "/dev/bin/remote_script"
    rc=$?
    echo "$rc\n"
    then the return code that I get is not actually the return code from the remote_scrpit, but it is the return code from the rsh command that is 0 (success) because the rsh command actually executed successfully even though the remote_script could've returned something other than success. How can I get the return code from the remote_script passed back to the rsh calling script?
    Jan Miller
    [email protected]
    202-237-9584

    Please ignore the first paragraph of my previous post.

  • Getting Return Code for cl_gui_frontend_services= execute

    Hey,
    im using the static method cl_gui_frontend_services=>execute  to start a program locally. The program is openens synchronously and i need to get the return code of the program. I mean not the one from the method-call but from the external tool on OS-level.
    Is there a way to get that one ?
    Thanks and regards,
    oliver

    well seems there is no way...solved it now over a result-file which is get written by the called tool and later read by sap.

  • Getting return code from subprocess execution

    Hi,
    I am executing a batch file as a subprocess and need to get the return code from it.
    The batch file executes a java class, which exits (System.exits(rc)) with a return code on error and how this can be captured in the calling program.
    i am calling the batch file as follows: (fragment)
    Runtime r;
    process p = r.exec(execCmd, null, mqsiToolFile);
    istr = p.getInputStream();
    br = new BufferedReader(new InputStreamReader(istr));          
    returnCode = p.waitFor();
    System.out.println("exit value: "+p.exitValue());
    This successfully executes the subprocess and always returns with code '0', even though the sub-process exits with a code >0.
    p.waitFor() or p.exitValue() - doesn't giving the exit value of the subprocess.
    How can i capture the exit value (System.exit(rc)) from the sub-process.
    I am running the app on Windows NT4 sp6
    Any help would be greatful.
    Thanks in Advance.

    Peter,
    can u be more explanative on this, i can see the run time result (0, 1). But couldn't get familiar on the sample you have given.
    My code is as follows:
    Process p = null;
    Runtime r = Runtime.getRuntime();
    for loop {
    execSubProcess(.., .., ..)
    public int execSubProcess(String excmd, String[] env, File fileDir) throws Exception {
    int res = 0;
         try {
              System.out.println(excmd);
              p = r.exec(excmd, null, fileDir);
              istr = p.getInputStream();
              br = new BufferedReader(new InputStreamReader(istr));
              line = null;
              while ((line = br.readLine()) != null) {
                   System.out.println(line);
              res = p.waitFor();
         System.out.println("sub-process return code: "+p.waitFor());
              System.out.println("sub-process exitValue: "+p.exitValue());
         } catch (Exception e) {
         throw e;
         return res;
    Here i get all the time 'res=0' , even though the subprocess execCmd exits with a return code > 0.
    Is tehre any environment setup or ..needed to capture the subprocess exit code val (System.exit(rc)) in the calling program.
    Please provide more details as per ur convinience.
    thanks

  • How to get return code or parameters from PL/SQL in my shell script ?

    My shell script must check the result of PL/SQL's running, and decide what to do in the next step.

    I think you put the problem the wrong way.
    You should try to do as much as possible through your SQL scripts, and, if you need to make OS calls, you may do that using host(command_string).
    If you need to transfer parameters from other programs to your FORMS (PL/SQL), then you have to see user_exit.
    Some other means would be to have your PL/SQL write to certain OS files that the shell script may read, but that doesn't seem like good practice to me.

  • Is it possible to get the code of an applet ?

    I want to develop an application and offer it throughinternet.
    One time the applet is running, is there any knowed location of the archives downloaded ?
    Can anybody search it, copy it and decompile it ?
    Thanks

    tonnot wrote:
    Thank you for the answer.
    But, Is there any way to avoid it ?Not really. Anyone can download the jar file. Anyone can extract the content of the jar file. Anyone can download 'jad' or some other decompilation tool and use it to get the decompiled source. Some people will be able to make use of that decompiled source code. If you use an obfuscator then less people will be able to make use of the decompiled obfuscated source code.
    ( I suppose that it is neccesary J2EE ? ) No.

  • How to get return code of compiling a package

    Hi,
    i want to compile a package and if it was not succesfull to write the error_message from "show errors" into a file.
    thx
    Wolle

    the problem with compiling individual packages is that you might inadvertently invalidate others. you should also programmatically check package dependencies too so you dont break any accidentally.
    if you're only compiling package bodies, this shouldn't be an issue, but if youre also compiling specs, this is something you should keep an eye on.
    i wrote an application that uploads new packages i commit in cvs to our database and then recompiles them. it then reports whether or not compilation was successful. this helps eliminate alot of user error when people manually recompile packages in HA environments. however, i recompile the entire schema when i do this (this is not something run very often). i can get away with this at my shop because the schema is very small, but this might not be a practical solution for everyone.
    this is how i check for dependencies:
    FROM public_dependency pd, user_objects uo
    WHERE referenced_object_id IN (select object_id from user_objects where object_name= UPPER(?))
    AND uo.object_id = pd.object_id
    this is useful for saving a snapshot of current package (in case of reversion):
    SELECT TEXT FROM USER_SOURCE WHERE NAME = ?
    this is how you can recompile the schema:
    DBMS_UTILITY.COMPILE_SCHEMA(?, TRUE, TRUE);
    i do a check for invalid objects in the schema before i even start (And exit with error if any are found) :
    SELECT OBJECT_NAME, STATUS
    FROM USER_OBJECTS
    WHERE (OBJECT_TYPE='PACKAGE' OR OBJECT_TYPE='PACKAGE BODY')
    AND STATUS <> 'VALID'
    Hope this info helps.
    Edited by: user577162 on Aug 25, 2008 2:21 PM

Maybe you are looking for

  • ITunes 10.1 and iPhone 4 - failure to connect / sync

    Hi Apologies if this is already out there but couldn't see. Since iTunes 10.x, neither iPhone 4 can connect to main XP PC through iTunes. The iPhones screens themselves flick up a "this accessory doesn't charge" message, just momentarily but repeated

  • Flash player probs in iweb

    Never had this before but recently I can hardlly access my own page because of this: "A script in this movie is causing Macromedia Flash Player 8 to run slowly. If it continues to run, your computer may become unresponsive. Do you want to abort the s

  • Question for Deskject 3520 e-all in one re: printing fonts and one sheet preference

    For a Deskjet 3520 e - all in one - printing from Ipad -How do I adjust fonts and make my printer print one side only ?

  • Connecting form 6i  to oracle database 10G express edition

    I am unable to connect forms 6i to oracle database 10G express edition. form builder closes without any message.

  • Interactive list

    Hi, I am displaying some list using a write statement with column heading. the list which is displayed is interactive. on double clicking on first list, it goes to next screen and shows second list. My problem is that i want to set different column h