LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices



Reply
 
Search this Thread
Old 05-19-2011, 05:41 AM   #1
AnarKEY
LQ Newbie
 
Registered: May 2011
Distribution: Gentoo
Posts: 8

Rep: Reputation: 0
bash: HISTTIMEFORMAT ignored by root user


Hey all,
Is use debian lenny and kernel 2.6.26-2-xen-amd64 and want do show timestamps per command in bash history. It works an most machines, but one machine doesn't.
I export HISTTIMEFORMAT in "etc/profile":
Code:
export HISTTIMEFORMAT="%F %T "
I look it with user xyz, history works. If i 'su -', history works, too. But if i just 'su', there's no history saved.
If I export HISTTIMEFORMAT in /root/.bashrc, history works for "su", too.

Couriously, if i switch to root-user per "su", and I list the environment-variables with 'env', I can see that HISTTIMEFORMAT is set correctly, but seems to be ignored. No other History-Variables like HISTCONTROL are set.

As I told, the same configuration works on other machines without any problems. I would be pleased for every hint to understand this issue. Thx.
 
Old 05-19-2011, 04:37 PM   #2
alan_ri
Senior Member
 
Registered: Dec 2007
Location: Croatia
Distribution: Debian GNU/Linux
Posts: 1,733
Blog Entries: 5

Rep: Reputation: 127Reputation: 127
Well, if you don't use - then login profile for root is not executed, and your environment variables, and aliases will not change.
Quote:
- Pass the environment along unchanged, as if the user actually logged in as the specified user.
What distro/s are on the other machines?
 
Old 05-20-2011, 04:21 AM   #3
AnarKEY
LQ Newbie
 
Registered: May 2011
Distribution: Gentoo
Posts: 8

Original Poster
Rep: Reputation: 0
Thanx for you answer.

Quote:
Originally Posted by alan_ri View Post
What distro/s are on the other machines?
There are about 20 debian lenny and 20 debian squeeze where the HISTTIMEFORMAT works. It doesn't work an a single debian egde machine, but I've just one and this will be updated very soon so I don't care about this one.

What I don't understand: The environment variable HISTTIMEFORMAT is set correctly, and I can't see any difference in the configuration of the machine where is it works and the one (two) who doesn't.
 
Old 05-20-2011, 05:03 AM   #4
alan_ri
Senior Member
 
Registered: Dec 2007
Location: Croatia
Distribution: Debian GNU/Linux
Posts: 1,733
Blog Entries: 5

Rep: Reputation: 127Reputation: 127
Hmm, you have to understand that Etch is very old release now and since it's just one machine which will be updated as you said...

Maybe you could read release notes for Etch;
http://www.debian.org/releases/etch/releasenotes

There maybe you'll find something. I can't tell at this moment how things were set up in Etch, but there've been something like 50 000 package changes between Etch and Squeeze.
 
Old 05-26-2011, 03:59 AM   #5
AnarKEY
LQ Newbie
 
Registered: May 2011
Distribution: Gentoo
Posts: 8

Original Poster
Rep: Reputation: 0
After updating this machine to squeeze, HISTTIMEFORMAT works fine. Thanx for your answers.
 
  


Reply

Tags
bash, debianlenny, history, su


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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: HISTTIMEFORMAT: readonly variable chavete88 Slackware 2 11-11-2010 10:09 AM
detecting root user in a bash script radiodee1 Programming 2 11-30-2008 07:18 AM
Root user bash shell look like "bash-2.05b#" and /root empty y2pk001 Linux - Security 6 03-22-2007 09:33 PM
root user and bash unihiekka Linux - Software 3 12-22-2005 10:11 AM
bash 'net connection via wvdial through non-root user Dralnu Linux - Networking 2 12-17-2005 06:31 PM


All times are GMT -5. The time now is 10:55 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration