history utility
James B. Byrne
byrnejb at harte-lyne.ca
Fri May 20 18:27:10 UTC 2016
As is no doubt obvious from what I am trying to do I come from a bash
background.
While logged in as root I run the history command and see this:
# history
1 20:02 date 12:13:30
2 20:03 date 121350
3 13:51 man adjtime
4 13:51 apropos clock
5 13:52 apropos time
6 13:53 man adjkerntz
7 13:58 man clock
8 13:58 man hwclock
9 14:00 man date
. . .
I am used to bash and have this in my root .bash_profile on other
systems.
# Timestamp History
export HISTTIMEFORMAT='%F %T: '
Looking in the default ~/.profile I see this:
# $FreeBSD: releng/10.3/etc/root/dot.profile 199243 2009-11-13
05:54:55Z ed $
#
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:~/bin
export PATH
HOME=/root
export HOME
TERM=${TERM:-xterm}
export TERM
PAGER=more
export PAGER
Which to me implies that adding this should work.
echo "export HISTTIMEFORMAT='%F %T: '" >> .profile
But nooo. What I see from source .profile is:
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:~/bin:
Command not found.
export: Command not found.
HOME=/root: Command not found.
export: Command not found.
Bad : modifier in $ (-).
Which tells me that .profile is either processed differently than I
expect or not at all.
So, my questions are:
What is the purpose of .profile?
How is it used?
Why is there no export command found given that man sh explicitly
mentions the builtin command 'export'?
--
*** e-Mail is NOT a SECURE channel ***
Do NOT transmit sensitive data via e-Mail
Do NOT open attachments nor follow links sent by e-Mail
James B. Byrne mailto:ByrneJB at Harte-Lyne.ca
Harte & Lyne Limited http://www.harte-lyne.ca
9 Brockley Drive vox: +1 905 561 1241
Hamilton, Ontario fax: +1 905 561 0757
Canada L8E 3C3
More information about the freebsd-questions
mailing list