FAQ
May be you are missing straming mode setting on the remote machine where
the telnet server is running on.

Enable the straming mode

    1. Logon to machine klpwpst01.klp.no and klpwpst02.klp.no
    2. Open a command prompt with Run as Administrator privilage.
    3. Run following command

tlntadmn config mode=stream



On Thursday, August 16, 2012 4:28:21 AM UTC+2, lewgun wrote:

Hi all.
I had used os/exec to run "telent" under window 7 64bit, it 's failed
with error : "exit status -1", the source as follow, how can i solve it ?

import (
"bytes"
"fmt"
"os/exec"
)

func main() {

var (

cmd *exec.Cmd

out bytes.Buffer

)

cmd = exec.Command("telnet", "163.com", "80")

//cmd.Env = os.Environ()

cmd.Stdout = &out

if err := cmd.Run(); err != nil {

fmt.Println(err) //exit status -1

return

}

fmt.Println(out.String())

}




--
Face the sea, for the spring flowers blossoming



--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Egon at Aug 14, 2014 at 3:31 pm

    On Thursday, 16 August 2012 05:28:21 UTC+3, lewgun wrote:
    Hi all.
    I had used os/exec to run "telent" under window 7 64bit, it 's failed
    with error : "exit status -1", the source as follow, how can i solve it ?

    import (
    "bytes"
    "fmt"
    "os/exec"
    )

    func main() {

    var (

    cmd *exec.Cmd

    out bytes.Buffer

    )

    cmd = exec.Command("telnet", "163.com", "80")

    //cmd.Env = os.Environ()

    cmd.Stdout = &out

    if err := cmd.Run(); err != nil {

    fmt.Println(err) //exit status -1

    return

    }

    fmt.Println(out.String())

    }

    What are you trying to accomplish?
    <https://code.google.com/p/go-wiki/wiki/HowToAsk>

    This looks a very weird way to use telnet.

    There are telnet packages available:
    * https://github.com/ziutek/telnet
    * https://github.com/egonelbre/mud/tree/master/telnet/

    + egon


    --
    Face the sea, for the spring flowers blossoming



    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedAug 14, '14 at 2:11p
activeAug 14, '14 at 3:31p
posts2
users2
websitegolang.org

2 users in discussion

Tade Ankur: 1 post Egon: 1 post

People

Translate

site design / logo © 2022 Grokbase