LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 07-15-2008, 11:26 AM   #1
786
LQ Newbie
 
Registered: Jul 2008
Posts: 8

Rep: Reputation: 0
TERM environment variable not set


Hi,

I need help from someone. actually i am trying to run multiple "gnome-terminal" using bash script on Fedora. it works properly when i run by ./filename. but when i use "sudo crontab" its give me message "TERM environment variable not set".

my bash script mention below.

#!/bin/bash
TERM=xterm
COLORTERM=gnome-terminal
gnome-terminal

Last edited by 786; 07-15-2008 at 11:37 AM.
 
Old 07-15-2008, 12:22 PM   #2
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
Well, you might need to export your variables. Your script really makes no sense, you basically created a script to just launch gnome-terminal.

If you need TERM setup, you need to have something like.. export TERM=xterm in there.
 
Old 07-15-2008, 12:39 PM   #3
786
LQ Newbie
 
Registered: Jul 2008
Posts: 8

Original Poster
Rep: Reputation: 0
I also tried like.

export=TERM xterm
COLORTERM=gnome-terminal
gnome-terminal

but its give me following message.

X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/root>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=root>
X-Cron-Env: <USER=root>

TERM environment variable not set.
Warning: This program is an suid-root program or is being run by the root user.
The full text of the error or warning message cannot be safely formatted
in this environment. You may get a more descriptive message by running the
program as a non-root user or by removing the suid bit on the executable.
xterm Xt error: Can't open display: %s
xterm: DISPLAY is not set
 
Old 07-15-2008, 12:43 PM   #4
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
Well, like I said, you have a script that doesn't make sense. You basically wrote a script to just launch gnome-terminal. If you want the variables TERM and COLORTERM set in the new gnome-terminal session, you need to run these within that terminal. The simple thing to do is to put these environment variables in your users .bashrc or .bash_profile, etc.
 
Old 07-15-2008, 01:40 PM   #5
786
LQ Newbie
 
Registered: Jul 2008
Posts: 8

Original Poster
Rep: Reputation: 0
Once my GUI interface appear i want to run gnome-terminal after specific time period. my requirment is just want to run gnome-terminal using shell script and this script run automatically by "sudo crontab" like
"????? /file/folder"


--------Shell script--------
#!/bin/bash
gnome-terminal




if i try to run like (./filename) its working properly. but i want to run this script through "sudo crontab". whenever i tried through "sudo crontab" it gives me error.

I also have been tried .bashrc and .bash_profile. they are not fullfill my requirments.

i really appreciate you if you help me out. thanks
 
Old 07-15-2008, 01:46 PM   #6
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
Wait, you want gnome-terminal to launch from a crontab entry?
 
Old 07-15-2008, 04:16 PM   #7
786
LQ Newbie
 
Registered: Jul 2008
Posts: 8

Original Poster
Rep: Reputation: 0
Yes, I think your are right.
 
Old 07-15-2008, 04:20 PM   #8
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
Quote:
Originally Posted by 786 View Post
Yes, I think your are right.
It's just not going to work like that. Crond is a daemon, in order to start an application under your own session, it won't have permissions and or it's not designed to do such things.

What you might be looking for is the at command, but then again, I don't think that's going to work either.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] TERM environment variable not set vikas027 Programming 6 10-23-2007 09:13 AM
Use of TERM environment variable saandeep_jan Linux - Newbie 1 08-30-2007 03:55 PM
Where is global TERM variable set? tonyfreeman Red Hat 1 02-20-2007 02:20 PM
scp error, TERM env. variable not set? jimbo Linux - Networking 2 11-26-2005 01:31 AM
Cron: TERM environment variable not set. hydro Linux - General 4 04-15-2004 10:59 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:24 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