<?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: shell question in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/shell-question/m-p/3851132#M24889</link>
    <description>From the 'ksh' man page;&lt;BR /&gt;&lt;BR /&gt;NOTE:  if HISTFILE isn't set, no history file is used. This is different from the original Korn shell, which uses $HOME/.sh_history; in future, pdksh may also use a default history file.&lt;BR /&gt;&lt;BR /&gt;So by default your ksh history is only temporarily stored in a buffer and will be lost when you log out. To make it permanent you can use the following line in ~/.bash_profile (if bash is your login shell);&lt;BR /&gt;&lt;BR /&gt;export HISTFILE=${HOME}/.sh_history (or whatever you want to call it). You will need to logout/login to take affect.&lt;BR /&gt;&lt;BR /&gt;David</description>
    <pubDate>Mon, 28 Aug 2006 07:59:43 GMT</pubDate>
    <dc:creator>David Child_1</dc:creator>
    <dc:date>2006-08-28T07:59:43Z</dc:date>
    <item>
      <title>shell question</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-question/m-p/3851126#M24883</link>
      <description>RHEL3... if, as root, you're using bash as your default login shell, and then you issue "ksh -o vi", what file does your command history end up in?</description>
      <pubDate>Sun, 27 Aug 2006 17:12:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-question/m-p/3851126#M24883</guid>
      <dc:creator>joseph wholey</dc:creator>
      <dc:date>2006-08-27T17:12:31Z</dc:date>
    </item>
    <item>
      <title>Re: shell question</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-question/m-p/3851127#M24884</link>
      <description>The command-line history is actually kept in a file, called .bash_history in our login directory. We can read it in a number of ways: by using pico, cat, less, more.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sun, 27 Aug 2006 17:35:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-question/m-p/3851127#M24884</guid>
      <dc:creator>Ryan Goh</dc:creator>
      <dc:date>2006-08-27T17:35:37Z</dc:date>
    </item>
    <item>
      <title>Re: shell question</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-question/m-p/3851128#M24885</link>
      <description>Keep in mind that the .bash_history file is only updated once you logout.</description>
      <pubDate>Sun, 27 Aug 2006 19:16:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-question/m-p/3851128#M24885</guid>
      <dc:creator>Niels Endres</dc:creator>
      <dc:date>2006-08-27T19:16:25Z</dc:date>
    </item>
    <item>
      <title>Re: shell question</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-question/m-p/3851129#M24886</link>
      <description>Unless my environment is set up in a strange way, which I'm pretty sure it's not, my history file updates immediately after the command is issued.  But, what I'm really trying to get at is, if you issue "ksh -o vi" and then start issuing commands, you'll see you've started a brand new history file.  It does not log to .bash_history.  Where does it log? thx.</description>
      <pubDate>Sun, 27 Aug 2006 19:56:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-question/m-p/3851129#M24886</guid>
      <dc:creator>joseph wholey</dc:creator>
      <dc:date>2006-08-27T19:56:53Z</dc:date>
    </item>
    <item>
      <title>Re: shell question</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-question/m-p/3851130#M24887</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;If i am not mistaken each session can have it's own recorded history, and if you run a: &lt;BR /&gt;"env |grep -i histfile" you should find your relevant history file.&lt;BR /&gt;&lt;BR /&gt;I hope this helps.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Erkan.&lt;BR /&gt;</description>
      <pubDate>Sun, 27 Aug 2006 21:37:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-question/m-p/3851130#M24887</guid>
      <dc:creator>Erkan Saygili</dc:creator>
      <dc:date>2006-08-27T21:37:52Z</dc:date>
    </item>
    <item>
      <title>Re: shell question</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-question/m-p/3851131#M24888</link>
      <description>yes, you are right, it only save to .bash_history file after logout.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 28 Aug 2006 00:03:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-question/m-p/3851131#M24888</guid>
      <dc:creator>Ryan Goh</dc:creator>
      <dc:date>2006-08-28T00:03:40Z</dc:date>
    </item>
    <item>
      <title>Re: shell question</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-question/m-p/3851132#M24889</link>
      <description>From the 'ksh' man page;&lt;BR /&gt;&lt;BR /&gt;NOTE:  if HISTFILE isn't set, no history file is used. This is different from the original Korn shell, which uses $HOME/.sh_history; in future, pdksh may also use a default history file.&lt;BR /&gt;&lt;BR /&gt;So by default your ksh history is only temporarily stored in a buffer and will be lost when you log out. To make it permanent you can use the following line in ~/.bash_profile (if bash is your login shell);&lt;BR /&gt;&lt;BR /&gt;export HISTFILE=${HOME}/.sh_history (or whatever you want to call it). You will need to logout/login to take affect.&lt;BR /&gt;&lt;BR /&gt;David</description>
      <pubDate>Mon, 28 Aug 2006 07:59:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-question/m-p/3851132#M24889</guid>
      <dc:creator>David Child_1</dc:creator>
      <dc:date>2006-08-28T07:59:43Z</dc:date>
    </item>
    <item>
      <title>Re: shell question</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-question/m-p/3851133#M24890</link>
      <description>Try the following ... this probably where your history file is in ksh.&lt;BR /&gt;cat .sh_history&lt;BR /&gt;&lt;BR /&gt;Jean-Pierre Huc</description>
      <pubDate>Mon, 28 Aug 2006 08:48:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-question/m-p/3851133#M24890</guid>
      <dc:creator>Huc_1</dc:creator>
      <dc:date>2006-08-28T08:48:20Z</dc:date>
    </item>
    <item>
      <title>Re: shell question</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-question/m-p/3851134#M24891</link>
      <description>Hi Joseph,&lt;BR /&gt;&lt;BR /&gt;To change $HISTFILE for ksh without affecting bash, execute the following from bash:&lt;BR /&gt;&lt;BR /&gt;$ (HISTFILE=&lt;NEW_HF&gt; &amp;amp;&amp;amp; ksh)&lt;BR /&gt;&lt;BR /&gt;PCS&lt;/NEW_HF&gt;</description>
      <pubDate>Mon, 28 Aug 2006 09:06:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-question/m-p/3851134#M24891</guid>
      <dc:creator>spex</dc:creator>
      <dc:date>2006-08-28T09:06:37Z</dc:date>
    </item>
    <item>
      <title>Re: shell question</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-question/m-p/3851135#M24892</link>
      <description>My ultimate goal is to ensure logging regardless of whether the user issues "ksh -o vi" or not.  The default shell for root is bash, when root issues "ksh -o vi", nothing logs regardless of whether you set the suggested parameters or not. thx.</description>
      <pubDate>Mon, 28 Aug 2006 10:01:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-question/m-p/3851135#M24892</guid>
      <dc:creator>joseph wholey</dc:creator>
      <dc:date>2006-08-28T10:01:03Z</dc:date>
    </item>
    <item>
      <title>Re: shell question</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-question/m-p/3851136#M24893</link>
      <description>I disagree !!&lt;BR /&gt;&lt;BR /&gt;When as root # I issue a ksh -o vi I find that my history is in the file &lt;BR /&gt;.sh_history &lt;BR /&gt;&lt;BR /&gt;please note the dot before file name ".sh_history"&lt;BR /&gt;&lt;BR /&gt;I have done not setup on my ksh enviroment this is default.&lt;BR /&gt;&lt;BR /&gt;Jean-Pierre Huc</description>
      <pubDate>Mon, 28 Aug 2006 11:07:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-question/m-p/3851136#M24893</guid>
      <dc:creator>Huc_1</dc:creator>
      <dc:date>2006-08-28T11:07:33Z</dc:date>
    </item>
    <item>
      <title>Re: shell question</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-question/m-p/3851137#M24894</link>
      <description>I still couldn't find where the command history stored before it save to .bash_profile, but I know you save the current command history without logout by typing "history -w" command.&lt;BR /&gt; &lt;BR /&gt;</description>
      <pubDate>Mon, 28 Aug 2006 23:23:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-question/m-p/3851137#M24894</guid>
      <dc:creator>Ryan Goh</dc:creator>
      <dc:date>2006-08-28T23:23:43Z</dc:date>
    </item>
    <item>
      <title>Re: shell question</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-question/m-p/3851138#M24895</link>
      <description>... and that is because it does not get logged permanently.  Only for the life of the session.  This seems very basic, however, I've been searching for an answer to this for quite some time and have not been able to find a satisfactory solution.  And yes, I know I can force the other SA's to use "ss -u root", but that's not what I'm looking for.  &lt;BR /&gt;Again, to reiterate the problem:  RHEL3, root's default shell is /bin/bash.  If user su's to root and issues command "ksh -o vi", their history only logs while they are actively in that session.  After they log out, history is gone.</description>
      <pubDate>Sat, 02 Sep 2006 13:05:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-question/m-p/3851138#M24895</guid>
      <dc:creator>joseph wholey</dc:creator>
      <dc:date>2006-09-02T13:05:01Z</dc:date>
    </item>
    <item>
      <title>Re: shell question</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-question/m-p/3851139#M24896</link>
      <description>Joseph,&lt;BR /&gt;&lt;BR /&gt;Sorry for the late reply on this. I got tied up with some projects I'm working on and haven't had a chance to check back.&lt;BR /&gt;&lt;BR /&gt;You can get permanent history as already mentioned. You will just have two history files.&lt;BR /&gt;&lt;BR /&gt;Just add "export HISTFILE=${HOME}/.sh_history" to root's ~/.bashrc file.&lt;BR /&gt;&lt;BR /&gt;When someone logs in as root they will have their bash history (in ~/.bash_history). Then if someone runs 'ksh -o vi' their history will be recorded in ~/.sh_history. &lt;BR /&gt;&lt;BR /&gt;You can technically point HISTFILE to ${HOME}/.bash_history, but it won't work right as the formatting is different.&lt;BR /&gt;&lt;BR /&gt;Also, you might get a little more input from other forum members if you assign points. Members can easily see that you have only assigned points to one out of 94 reponses. Most of the  members in the forums will help either way, but it can't hurt.&lt;BR /&gt;&lt;BR /&gt;David&lt;BR /&gt;</description>
      <pubDate>Wed, 06 Sep 2006 12:21:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-question/m-p/3851139#M24896</guid>
      <dc:creator>David Child_1</dc:creator>
      <dc:date>2006-09-06T12:21:45Z</dc:date>
    </item>
    <item>
      <title>Re: shell question</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-question/m-p/3851140#M24897</link>
      <description>David,&lt;BR /&gt;&lt;BR /&gt;Thanks for the response.  That is exactly what I want.  Thank you for the advice as well.  I will heed it moving forward.  &lt;BR /&gt;&lt;BR /&gt;Regards, Joe</description>
      <pubDate>Wed, 06 Sep 2006 12:41:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-question/m-p/3851140#M24897</guid>
      <dc:creator>joseph wholey</dc:creator>
      <dc:date>2006-09-06T12:41:45Z</dc:date>
    </item>
  </channel>
</rss>

