LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-28-2006, 03:05 PM   #1
FirmbIT
LQ Newbie
 
Registered: Oct 2005
Posts: 27

Rep: Reputation: 15
Clear after each read in bash


Hello, I have a bash script running on one server, but I am executing it from a different server. So here is the way I'm calling it in the script:

ssh server "./script.sh"

and then it goes from there. Now in script.sh, the script is menu based and there are a bunch of read statments asked which then turn into variables. What I want to do to make the script look a little better as the user is going through is have a clear after each read statement. This of course works when executing the script from the server itself, but not when executing the script from another server. Here's the error:

Code:
no terminal type specified and no TERM environmental variable.
The script must be executed from this other server and not from the server with the actual script. How can I do this? Thank you.
 
Old 04-28-2006, 05:43 PM   #2
Vagrant
Member
 
Registered: Nov 2001
Posts: 75

Rep: Reputation: 15
Have you tried adding something like

Code:
TERM=cons25
after the #!/bin/bash line?
 
Old 04-28-2006, 05:57 PM   #3
ataraxia
Member
 
Registered: Apr 2006
Location: Pittsburgh
Distribution: Debian Sid AMD64
Posts: 296

Rep: Reputation: 30
set the TERM variable to some useful value inside the script itself. What kind of terminal are you running the ssh from?
 
Old 04-28-2006, 09:20 PM   #4
FirmbIT
LQ Newbie
 
Registered: Oct 2005
Posts: 27

Original Poster
Rep: Reputation: 15
What do you mean? I'm running it from PuTTY. Setting TERM to anything in both the symlink and the script does not work.
 
Old 04-29-2006, 12:57 PM   #5
ioerror
Member
 
Registered: Sep 2005
Location: Old Blighty
Distribution: Slackware, NetBSD
Posts: 536

Rep: Reputation: 34
Quote:
Setting TERM to anything in both the symlink and the script does not work.
Did you remember to export it?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Bash 'read' problem raypen Programming 5 03-25-2006 04:35 PM
How to clear a std::string buff.clear()? lucky6969b Programming 3 03-17-2006 07:50 AM
How do I read from a file in BASH? vous Programming 4 03-22-2005 06:51 PM
Help with BASH script PLEASE READ!!! hroman Programming 7 10-08-2004 07:39 PM
bash - read from file question sqn Programming 4 04-01-2003 04:30 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:44 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration