Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9214721
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T02:02:01+00:00 2026-06-18T02:02:01+00:00

I have an Ubuntu server which has a python script that runs a terminal

  • 0

I have an Ubuntu server which has a python script that runs a terminal command-based interface. I’m using plink to login and immediately execute the python script:

plink.exe -ssh -l goomuckel -pw greenpepper#7 192.168.1.201 "python server.py"

However, I get the following message:

TERM environment variable not set.

So I created a sh script (server.sh) on the Ubuntu machine:

export TERM=xterm
python server.py

Using the following plink command:

plink.exe -ssh -l goomuckel -pw greenpepper#7 192.168.1.201 "sh server.sh"

Now I don’t receive the warning anymore, it seems that the python script is execute. But instead of showing the terminal interface I’m printing in the python script, only the following characters are printed:

←[H←[2J

The weird thing is, when logging in manually with Putty and executing the python script, everything works fine. I’ve tried adding the -t flag to plink and then the script executes. However I’m using colors for printing the terminal text, and the colors are printed as text rather than changing the colors of the text as observed in Putty.

Any ideas what I can do?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T02:02:02+00:00Added an answer on June 18, 2026 at 2:02 am

    You don’t need to do this into a python script.

    You could simply modify .profile -that is a file that system will execute on every login – with the same expression you use into python script

    export TERM=xterm
    

    (if you use bash)

    setnv TERM xterm
    

    (for c-shell and similar)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem to install xdebug on my Ubuntu Server which is using
We have a ubuntu test server that this simple script works fine on where
I have an Ubuntu Oneiric server that runs several instances of ffmpeg (each one
I have an application which runs as a process on a ubuntu server. This
Ubuntu 11.10, Python 2.6. Background: I have an existing Python app that is using
I have written a server daemon (Linux, Ubuntu) which communicates with PHP as frontend
I have an ubuntu server (11.10) on a single-board computer that occasionally is subject
I have a bare-bones install of jenkins on my Ubuntu server that I installed
I have one Ubuntu Based memcache server. Now i want my new server to
I've installed CouchDB in Ubuntu 11.10. I have an HTTPD server running (which functions

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.