<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: re: root shell history in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/re-root-shell-history/m-p/3561223#M226533</link>
    <description>yes G.&lt;BR /&gt;obviously don't touch the sh!!!&lt;BR /&gt;just insert in the .profile&lt;BR /&gt;export HISTFILE=.sh_history&lt;BR /&gt;export HISTSIZE=400&lt;BR /&gt;export EDITOR=vi&lt;BR /&gt;&lt;BR /&gt;save the file, loguot and login again:&lt;BR /&gt;you will have a history file called .sh_history that takes 400 command in history&lt;BR /&gt;and you can you also the esc+k command to recall the commands&lt;BR /&gt;&lt;BR /&gt;Regds&lt;BR /&gt;LF</description>
    <pubDate>Fri, 10 Jun 2005 04:21:23 GMT</pubDate>
    <dc:creator>Lorenzo Facello</dc:creator>
    <dc:date>2005-06-10T04:21:23Z</dc:date>
    <item>
      <title>re: root shell history</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/re-root-shell-history/m-p/3561213#M226523</link>
      <description>this must be so obvious but,&lt;BR /&gt;&lt;BR /&gt;how do I enable the shell history for the root user?&lt;BR /&gt;&lt;BR /&gt;setting up a new HPUX RP3440 server and can't seem to figure this one out.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 09 Jun 2005 09:53:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/re-root-shell-history/m-p/3561213#M226523</guid>
      <dc:creator>Gurcharan Sahota_2</dc:creator>
      <dc:date>2005-06-09T09:53:11Z</dc:date>
    </item>
    <item>
      <title>Re: re: root shell history</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/re-root-shell-history/m-p/3561214#M226524</link>
      <description>You just need to add the line&lt;BR /&gt;&lt;BR /&gt;HISTFILE=/.sh_history&lt;BR /&gt;&lt;BR /&gt;to /.profile&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 09 Jun 2005 09:56:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/re-root-shell-history/m-p/3561214#M226524</guid>
      <dc:creator>Chris Wilshaw</dc:creator>
      <dc:date>2005-06-09T09:56:42Z</dc:date>
    </item>
    <item>
      <title>Re: re: root shell history</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/re-root-shell-history/m-p/3561215#M226525</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;# echo $SHELL&lt;BR /&gt;/sbin/sh&lt;BR /&gt;# set -o vi&lt;BR /&gt;&lt;BR /&gt;add this to your root .profile&lt;BR /&gt;&lt;BR /&gt;EDITOR=vi&lt;BR /&gt;PS1="$(hostname):\$PWD\# "&lt;BR /&gt;HISTFILE=${HOME}/.sh_history_`who am i|awk '{ print $1}'`&lt;BR /&gt;HISTSIZE=1000&lt;BR /&gt;export EDITOR HISTFILE PS1 HISTSIZE&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Robert-Jan</description>
      <pubDate>Thu, 09 Jun 2005 09:57:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/re-root-shell-history/m-p/3561215#M226525</guid>
      <dc:creator>Robert-Jan Goossens</dc:creator>
      <dc:date>2005-06-09T09:57:53Z</dc:date>
    </item>
    <item>
      <title>Re: re: root shell history</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/re-root-shell-history/m-p/3561216#M226526</link>
      <description>You should do this for all users&lt;BR /&gt;&lt;BR /&gt;HISTSIZE=500&lt;BR /&gt;HISTFILE=$HOME/.sh_history&lt;BR /&gt;export HISTFILE HISTSIZE&lt;BR /&gt;&lt;BR /&gt;Do it in /etc/profile&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Thu, 09 Jun 2005 09:58:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/re-root-shell-history/m-p/3561216#M226526</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2005-06-09T09:58:10Z</dc:date>
    </item>
    <item>
      <title>Re: re: root shell history</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/re-root-shell-history/m-p/3561217#M226527</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Just add these two lines in root's .profile.&lt;BR /&gt;export HISTFILE="/Path_to_file/$LOGNAME"&lt;BR /&gt;export HISTSIZE=1000&lt;BR /&gt;&lt;BR /&gt;Remove hash from last line in .dtprofile file lying in root's home directory for xterm.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;DTSOURCEPROFILE=true&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;Devender</description>
      <pubDate>Thu, 09 Jun 2005 09:58:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/re-root-shell-history/m-p/3561217#M226527</guid>
      <dc:creator>Devender Khatana</dc:creator>
      <dc:date>2005-06-09T09:58:43Z</dc:date>
    </item>
    <item>
      <title>Re: re: root shell history</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/re-root-shell-history/m-p/3561218#M226528</link>
      <description>Hi,&lt;BR /&gt;after the previous modifications in the .profile:&lt;BR /&gt;&lt;BR /&gt;touch /.sh_history&lt;BR /&gt;exit from the system and relog in it&lt;BR /&gt;&lt;BR /&gt;Enrico</description>
      <pubDate>Thu, 09 Jun 2005 10:19:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/re-root-shell-history/m-p/3561218#M226528</guid>
      <dc:creator>Enrico P.</dc:creator>
      <dc:date>2005-06-09T10:19:08Z</dc:date>
    </item>
    <item>
      <title>Re: re: root shell history</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/re-root-shell-history/m-p/3561219#M226529</link>
      <description>Our sysadms who have root access; with each 'su - root' a separate .sh_history is created with the user account name as a part of the .sh_history name.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;HST=`hostname`&lt;BR /&gt;USR=`who -um | awk '{print $1}'`&lt;BR /&gt;NAME=`whoami`# Set History File&lt;BR /&gt;  HISTFILE=/home/root/.sh_history_"${HST}"_"${USR}"-as-"${NAME}"_`date +%y%m%d.%&lt;BR /&gt;H%M%S_$$`&lt;BR /&gt;export HISTFILE&lt;BR /&gt;&lt;BR /&gt;As this example shows, each history file has the $USER name associated with it plus they are time/date stamped.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 09 Jun 2005 12:36:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/re-root-shell-history/m-p/3561219#M226529</guid>
      <dc:creator>Rick Garland</dc:creator>
      <dc:date>2005-06-09T12:36:09Z</dc:date>
    </item>
    <item>
      <title>Re: re: root shell history</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/re-root-shell-history/m-p/3561220#M226530</link>
      <description>I do like Rick:&lt;BR /&gt;&lt;BR /&gt;# Set up logging&lt;BR /&gt;HISTFILE=${HOME}/.sh_history_`who am i|awk '{ print $1}'`&lt;BR /&gt;export HISTFILE&lt;BR /&gt;print -s "### login at `/usr/bin/date` ###"&lt;BR /&gt;#date &amp;gt;&amp;gt;$HISTFILE&lt;BR /&gt;HISTSIZE=50000&lt;BR /&gt;export HISTSIZE&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;As well, testing timestamping of all commands:&lt;BR /&gt;&lt;BR /&gt;#trap to timestamp all commands&lt;BR /&gt;trap 'date "+# %c" | read -s' debug&lt;BR /&gt;&lt;BR /&gt;Rgds...Geoff</description>
      <pubDate>Thu, 09 Jun 2005 12:40:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/re-root-shell-history/m-p/3561220#M226530</guid>
      <dc:creator>Geoff Wild</dc:creator>
      <dc:date>2005-06-09T12:40:38Z</dc:date>
    </item>
    <item>
      <title>Re: re: root shell history</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/re-root-shell-history/m-p/3561221#M226531</link>
      <description>for just the "root" user's .profile or "/.profile" filename, we have:&lt;BR /&gt;&lt;BR /&gt;    export PS1="$LOGNAME@`hostname`:\$PWD# "&lt;BR /&gt;    export HISTFILE=.sh_history&lt;BR /&gt;</description>
      <pubDate>Thu, 09 Jun 2005 12:47:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/re-root-shell-history/m-p/3561221#M226531</guid>
      <dc:creator>D Block 2</dc:creator>
      <dc:date>2005-06-09T12:47:15Z</dc:date>
    </item>
    <item>
      <title>Re: re: root shell history</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/re-root-shell-history/m-p/3561222#M226532</link>
      <description>Most replies are about setting history variables. Be noted, not all shells do have a history meganism.&lt;BR /&gt;&lt;BR /&gt;Then, specially for root, donnot change the shell to a binary that is not in the root-filesystem. This shell is used in the single-user mode, where only the root-filesystem is available. Hence, donnot change this shell to something that needs libraries outside the root-filesystem...&lt;BR /&gt;&lt;BR /&gt;(this is based on experience, it ruins your day if single-user does not work once you need it.)</description>
      <pubDate>Fri, 10 Jun 2005 03:55:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/re-root-shell-history/m-p/3561222#M226532</guid>
      <dc:creator>C. Beerse_1</dc:creator>
      <dc:date>2005-06-10T03:55:23Z</dc:date>
    </item>
    <item>
      <title>Re: re: root shell history</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/re-root-shell-history/m-p/3561223#M226533</link>
      <description>yes G.&lt;BR /&gt;obviously don't touch the sh!!!&lt;BR /&gt;just insert in the .profile&lt;BR /&gt;export HISTFILE=.sh_history&lt;BR /&gt;export HISTSIZE=400&lt;BR /&gt;export EDITOR=vi&lt;BR /&gt;&lt;BR /&gt;save the file, loguot and login again:&lt;BR /&gt;you will have a history file called .sh_history that takes 400 command in history&lt;BR /&gt;and you can you also the esc+k command to recall the commands&lt;BR /&gt;&lt;BR /&gt;Regds&lt;BR /&gt;LF</description>
      <pubDate>Fri, 10 Jun 2005 04:21:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/re-root-shell-history/m-p/3561223#M226533</guid>
      <dc:creator>Lorenzo Facello</dc:creator>
      <dc:date>2005-06-10T04:21:23Z</dc:date>
    </item>
    <item>
      <title>Re: re: root shell history</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/re-root-shell-history/m-p/3561224#M226534</link>
      <description>You can try as,&lt;BR /&gt;&lt;BR /&gt;set -o $EDITOR&lt;BR /&gt;HISTFILE="/root/.sh_history&lt;BR /&gt;HISTSIZE=1000&lt;BR /&gt;&lt;BR /&gt;Put this in /etc/profile file and login in new terminal. It will get effect.&lt;BR /&gt;&lt;BR /&gt;hth.&lt;BR /&gt;</description>
      <pubDate>Fri, 10 Jun 2005 04:57:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/re-root-shell-history/m-p/3561224#M226534</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2005-06-10T04:57:40Z</dc:date>
    </item>
    <item>
      <title>Re: re: root shell history</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/re-root-shell-history/m-p/3561225#M226535</link>
      <description>thanks for the replies,&lt;BR /&gt;&lt;BR /&gt;but esc-k still does not work...&lt;BR /&gt;&lt;BR /&gt;i have stripped the down the .profile in /home/root to this &lt;BR /&gt;&lt;BR /&gt;export HISTFILE=.sh_history&lt;BR /&gt;export HISTSIZE=400&lt;BR /&gt;export EDITOR=vi&lt;BR /&gt;&lt;BR /&gt;any other reason(s) it doesn't work?&lt;BR /&gt;&lt;BR /&gt;I'm using terminal emulation software - SmarTerm Essential v9.0, could this be causing a problem?</description>
      <pubDate>Fri, 10 Jun 2005 05:53:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/re-root-shell-history/m-p/3561225#M226535</guid>
      <dc:creator>Gurcharan Sahota_2</dc:creator>
      <dc:date>2005-06-10T05:53:01Z</dc:date>
    </item>
    <item>
      <title>Re: re: root shell history</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/re-root-shell-history/m-p/3561226#M226536</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Possibally there is one of the case.&lt;BR /&gt;&lt;BR /&gt;1. define full path to .sh_history &amp;amp; ensure you can write that file as that user.&lt;BR /&gt;&lt;BR /&gt;2. If your this session uses Graphical display then check .dtprofile in that user's home directory &amp;amp; uncomment last line.&lt;BR /&gt;&lt;BR /&gt;3. Your Shell is not posix as it works only in Posix Shell. Confirm by "cat /etc/passwd |grep your_user". The shall displayed should be /usr/bin/sh in the end of the line.&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;Devender&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;Devender</description>
      <pubDate>Fri, 10 Jun 2005 06:02:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/re-root-shell-history/m-p/3561226#M226536</guid>
      <dc:creator>Devender Khatana</dc:creator>
      <dc:date>2005-06-10T06:02:46Z</dc:date>
    </item>
    <item>
      <title>Re: re: root shell history</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/re-root-shell-history/m-p/3561227#M226537</link>
      <description>Are you using CDE ?&lt;BR /&gt;&lt;BR /&gt;Check if the last line is uncommented in the $HOME/.dtprofile&lt;BR /&gt;&lt;BR /&gt;DTSOURCEPROFILE=true&lt;BR /&gt;&lt;BR /&gt;Robert-Jan</description>
      <pubDate>Fri, 10 Jun 2005 06:03:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/re-root-shell-history/m-p/3561227#M226537</guid>
      <dc:creator>Robert-Jan Goossens</dc:creator>
      <dc:date>2005-06-10T06:03:38Z</dc:date>
    </item>
    <item>
      <title>Re: re: root shell history</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/re-root-shell-history/m-p/3561228#M226538</link>
      <description>You have to put as,&lt;BR /&gt;&lt;BR /&gt;set -o vi&lt;BR /&gt;&lt;BR /&gt;so that esc+k will get effect.&lt;BR /&gt;&lt;BR /&gt;Add, just close that session and restart the new session. It will get effect.&lt;BR /&gt;&lt;BR /&gt;hth.&lt;BR /&gt;</description>
      <pubDate>Fri, 10 Jun 2005 06:07:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/re-root-shell-history/m-p/3561228#M226538</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2005-06-10T06:07:15Z</dc:date>
    </item>
    <item>
      <title>Re: re: root shell history</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/re-root-shell-history/m-p/3561229#M226539</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;#ksh -o vi is not required here. Allthough works.&lt;BR /&gt;&lt;BR /&gt;You can check wheather your two veriales are set by &amp;amp; home of root is generally / not /home/root in HP.&lt;BR /&gt;&lt;BR /&gt;#set |grep -i hist&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;Devender</description>
      <pubDate>Fri, 10 Jun 2005 06:16:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/re-root-shell-history/m-p/3561229#M226539</guid>
      <dc:creator>Devender Khatana</dc:creator>
      <dc:date>2005-06-10T06:16:37Z</dc:date>
    </item>
    <item>
      <title>Re: re: root shell history</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/re-root-shell-history/m-p/3561230#M226540</link>
      <description>It[s really important to code the HISTFILE relative to each user:&lt;BR /&gt; &lt;BR /&gt;export HISTFILE=$HOME/.sh_history&lt;BR /&gt; &lt;BR /&gt;As has been mentioned several times in the HP-UX forums, / is a very, very bnad place to have root's $HOME directory. And if HISTFILE=.sh_history, it will only work when you are in the $HOME directory...some root profiles may cd somewhere else... &lt;BR /&gt; &lt;BR /&gt;And you might as well setup a size and an editor:&lt;BR /&gt; &lt;BR /&gt;export HISTSIZE=500&lt;BR /&gt;export EDITOR=/usr/bin/vi&lt;BR /&gt; &lt;BR /&gt;Put these lines in /etc/profile and everyone will have .sh_history setup. NOTE: root is unique in that if $HOME/.sh_history does NOT already exist, it will not be created (other users will have .sh_history created though). Just do this as root:&lt;BR /&gt; &lt;BR /&gt;touch $HOME/.sh_history&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt;Now, everything will work--UNLESS you are using Xwindows. Unfortunately, Xwindows defaults to NO /eetc/profile and NO .profile execution for local terminal emulators such as xterm, hpterm and dtterm. To fix this:&lt;BR /&gt; &lt;BR /&gt;echo "*loginShell:true" &amp;gt;&amp;gt; $HOME/.Xdefaults&lt;BR /&gt; &lt;BR /&gt;This solves the rather crazy CDE method of specifying DTSOURCEPROFILE which is only half correct (never sources /etc/profile, only .profile). The loginShell setting makes the terminal emulators work like all classic telnet or ssh logins.&lt;BR /&gt; &lt;BR /&gt;Note also that just typing these variables on the command line won't enable the shell history. It has to be set during /etc/profile or .profile execution.</description>
      <pubDate>Fri, 10 Jun 2005 06:40:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/re-root-shell-history/m-p/3561230#M226540</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2005-06-10T06:40:19Z</dc:date>
    </item>
    <item>
      <title>Re: re: root shell history</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/re-root-shell-history/m-p/3561231#M226541</link>
      <description>You have a potential serious problem, and I hope it's ONLY a TYPO on your part:&lt;BR /&gt;&lt;BR /&gt;You NEVER EVER put the "root" login directory in any place than UNDER / as a regular directory. You can put it in a directorty called /root or /potato, but you NEVER put root under any OTHER MOUNTED directory. PERIOD!&lt;BR /&gt;&lt;BR /&gt;POST the output from the following to VERIFY where the root login directory is:&lt;BR /&gt;grep root /etc/passwd&lt;BR /&gt;&lt;BR /&gt;In /etc/profile, I have this at the end:&lt;BR /&gt;&lt;BR /&gt;export HISTFILE=~/.sh_history_`logname`&lt;BR /&gt;export HISTSIZE=500000&lt;BR /&gt;export PS1="[`logname`@`hostname` "'${PWD}]# '&lt;BR /&gt;export EDITOR=vi&lt;BR /&gt;set -o vi&lt;BR /&gt;&lt;BR /&gt;As for wether or not your SmarTerm-less software is screwing with "ESC K", try openning a command prompt in WINDOZE and telnet'ing to your box without the use of SmarTerm-less.&lt;BR /&gt;&lt;BR /&gt;If it doesn't work, then please post the output of:&lt;BR /&gt;&lt;BR /&gt;env&lt;BR /&gt;&lt;BR /&gt;stty -a&lt;BR /&gt;&lt;BR /&gt;set&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry d brown jr</description>
      <pubDate>Fri, 10 Jun 2005 06:49:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/re-root-shell-history/m-p/3561231#M226541</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2005-06-10T06:49:54Z</dc:date>
    </item>
    <item>
      <title>Re: re: root shell history</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/re-root-shell-history/m-p/3561232#M226542</link>
      <description>no CDE,&lt;BR /&gt;&lt;BR /&gt;running the set | grep -i hist returns nothing...&lt;BR /&gt;&lt;BR /&gt;really puzzeled, I even copied the /etc/profile and /home/root/.profile scripts from out live servers and they don't work either.</description>
      <pubDate>Fri, 10 Jun 2005 07:02:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/re-root-shell-history/m-p/3561232#M226542</guid>
      <dc:creator>Gurcharan Sahota_2</dc:creator>
      <dc:date>2005-06-10T07:02:21Z</dc:date>
    </item>
  </channel>
</rss>

