Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 May 2016 14:17:09 -0400
From:      "James B. Byrne" <byrnejb@harte-lyne.ca>
To:        freebsd-questions@freebsd.org
Subject:   history utility
Message-ID:  <af5631f60eb1e33606eaf16362835193.squirrel@webmail.harte-lyne.ca>

Next in thread | Raw E-Mail | Index | Archive | Help
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@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




Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?af5631f60eb1e33606eaf16362835193.squirrel>