<?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 queries in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-queries/m-p/3045971#M812733</link>
    <description>Thanks for the very useful advice Massimo.&lt;BR /&gt;&lt;BR /&gt;I don't know why, but on one of my systems I'm not able to set history for the default /sbin/sh shell. I have the variables defined, and DTSOURCEPROFILE=true uncommented, but no success. HISTFILE defined and created.&lt;BR /&gt;&lt;BR /&gt;Another thing ... Is there no HOSTNAME built in shell variable?&lt;BR /&gt;&lt;BR /&gt;And does the Korn shell not require the HISTFILE variable defined, or the history file itself. I noted history working in ksh despite deleting the .sh_history.</description>
    <pubDate>Mon, 11 Aug 2003 07:42:06 GMT</pubDate>
    <dc:creator>Omar Alvi_1</dc:creator>
    <dc:date>2003-08-11T07:42:06Z</dc:date>
    <item>
      <title>shell queries</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-queries/m-p/3045966#M812728</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;The default shell for root is /sbin/sh and not /usr/bin/sh. Why? (maybe for sigle user mode?) Does it still have all POSIX functionality.&lt;BR /&gt;&lt;BR /&gt;I read that vi is on by default for POSIX (/usr/bin/sh), but I have to turn it on manually set -o vi.&lt;BR /&gt;&lt;BR /&gt;Why doesn't my env variable $SHELL's value change when I change my shell?&lt;BR /&gt;&lt;BR /&gt;As for recalling history, is it that the POSIX shell requires the HISTFILE variable to be defined whereas the Korn shell (/usr/bin/ksh) does not.&lt;BR /&gt;&lt;BR /&gt;From where does the vi read history command if I have removed the .sh_history file?&lt;BR /&gt;&lt;BR /&gt;Simple questions, but put together they're somewhat confusing&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;-Alvi</description>
      <pubDate>Mon, 11 Aug 2003 05:50:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-queries/m-p/3045966#M812728</guid>
      <dc:creator>Omar Alvi_1</dc:creator>
      <dc:date>2003-08-11T05:50:29Z</dc:date>
    </item>
    <item>
      <title>Re: shell queries</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-queries/m-p/3045967#M812729</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;If the shell lived in root, then you would not be able to boot single user or maintenance level.&lt;BR /&gt;&lt;BR /&gt;The posix shell does require the HISTFILE environment variable to be defined.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Hope it helps</description>
      <pubDate>Mon, 11 Aug 2003 06:02:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-queries/m-p/3045967#M812729</guid>
      <dc:creator>Tim Adamson_1</dc:creator>
      <dc:date>2003-08-11T06:02:11Z</dc:date>
    </item>
    <item>
      <title>Re: shell queries</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-queries/m-p/3045968#M812730</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;1 Yes it is for single user mode / maintenance mode /usr is not mounted in single user mode, therefore your system will not boot if you use /usr/bin/sh as a shell for root.&lt;BR /&gt;&lt;BR /&gt;2 .profile variable for SHELL /sbin/sh&lt;BR /&gt;&lt;BR /&gt;EDITOR=vi&lt;BR /&gt;export EDITOR&lt;BR /&gt;&lt;BR /&gt;3 .profile variables&lt;BR /&gt;&lt;BR /&gt;HISTFILE=/root/.sh_history&lt;BR /&gt;PS1="$(hostname):\$PWD\# "&lt;BR /&gt;HISTSIZE=250&lt;BR /&gt;export HISTFILE PS1 HISTSIZE&lt;BR /&gt;&lt;BR /&gt;4 .sh_history will be recreated at next login.&lt;BR /&gt;&lt;BR /&gt;Hope it helps,&lt;BR /&gt;&lt;BR /&gt;Robert-Jan.</description>
      <pubDate>Mon, 11 Aug 2003 06:07:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-queries/m-p/3045968#M812730</guid>
      <dc:creator>Robert-Jan Goossens</dc:creator>
      <dc:date>2003-08-11T06:07:13Z</dc:date>
    </item>
    <item>
      <title>Re: shell queries</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-queries/m-p/3045969#M812731</link>
      <description>Hi,&lt;BR /&gt;in addition to previous execllent respinse, i add this:&lt;BR /&gt;&lt;BR /&gt;export HISTFILE=$HOME/.sh_history`tty|tr / _`&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;With this setting of history file, expecially usefull for root, each separate root connection will have his own history file, with many important consequences:&lt;BR /&gt;&lt;BR /&gt;- every other root can check what the other is doing separately,&lt;BR /&gt;- you get no "rm -r *" by accident, recalling hte command of someone else&lt;BR /&gt;- when you login interactively, with "who -HRT" you can check what the others are doing&lt;BR /&gt;&lt;BR /&gt;   Massimo</description>
      <pubDate>Mon, 11 Aug 2003 06:25:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-queries/m-p/3045969#M812731</guid>
      <dc:creator>Massimo Bianchi</dc:creator>
      <dc:date>2003-08-11T06:25:51Z</dc:date>
    </item>
    <item>
      <title>Re: shell queries</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-queries/m-p/3045970#M812732</link>
      <description>Hi Omar,&lt;BR /&gt;The SHELL variable only shows the login shell, i.e. the original shell, therefore it does not change.&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;John K.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 11 Aug 2003 06:55:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-queries/m-p/3045970#M812732</guid>
      <dc:creator>john korterman</dc:creator>
      <dc:date>2003-08-11T06:55:36Z</dc:date>
    </item>
    <item>
      <title>Re: shell queries</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-queries/m-p/3045971#M812733</link>
      <description>Thanks for the very useful advice Massimo.&lt;BR /&gt;&lt;BR /&gt;I don't know why, but on one of my systems I'm not able to set history for the default /sbin/sh shell. I have the variables defined, and DTSOURCEPROFILE=true uncommented, but no success. HISTFILE defined and created.&lt;BR /&gt;&lt;BR /&gt;Another thing ... Is there no HOSTNAME built in shell variable?&lt;BR /&gt;&lt;BR /&gt;And does the Korn shell not require the HISTFILE variable defined, or the history file itself. I noted history working in ksh despite deleting the .sh_history.</description>
      <pubDate>Mon, 11 Aug 2003 07:42:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-queries/m-p/3045971#M812733</guid>
      <dc:creator>Omar Alvi_1</dc:creator>
      <dc:date>2003-08-11T07:42:06Z</dc:date>
    </item>
    <item>
      <title>Re: shell queries</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-queries/m-p/3045972#M812734</link>
      <description>&amp;gt;I don't know why, but on one of my systems I'm &amp;gt;not able to set history for the default /sbin/sh &amp;gt;shell. I have the variables defined, and &amp;gt;DTSOURCEPROFILE=true uncommented, but no &amp;gt;success. HISTFILE defined and created.&lt;BR /&gt;&lt;BR /&gt;Can you try to telnet to the server anc check? Maybe is related to DCE and not to the settings&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;gt;Another thing ... Is there no HOSTNAME built in &amp;gt;shell variable?&lt;BR /&gt;&lt;BR /&gt;No,&lt;BR /&gt;but you can define your own in .profile&lt;BR /&gt;&lt;BR /&gt;HOSTNAME=$(hostname)&lt;BR /&gt;&lt;BR /&gt;&amp;gt;And does the Korn shell not require the &amp;gt;HISTFILE variable defined, or the history file &amp;gt;itself. I noted history working in ksh despite &amp;gt;deleting the .sh_history.&lt;BR /&gt;&lt;BR /&gt;If you were using ksh and after deleted the .sh_history, at next logon history won't work.&lt;BR /&gt;AFAIK it uses the file, bua file can be deleted even if it is open by another process (thanks unix!). &lt;BR /&gt;&lt;BR /&gt;Test this:&lt;BR /&gt;&lt;BR /&gt;vi pippo.txt&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;edit it, leaving it open&lt;BR /&gt;&lt;BR /&gt;from another shell, delete pippo.txt.&lt;BR /&gt;&lt;BR /&gt;You will be able to edit it the same :)&lt;BR /&gt;&lt;BR /&gt; Massimo&lt;BR /&gt;</description>
      <pubDate>Mon, 11 Aug 2003 08:22:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-queries/m-p/3045972#M812734</guid>
      <dc:creator>Massimo Bianchi</dc:creator>
      <dc:date>2003-08-11T08:22:03Z</dc:date>
    </item>
    <item>
      <title>Re: shell queries</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-queries/m-p/3045973#M812735</link>
      <description>Found out why the history wasn't working.&lt;BR /&gt;&lt;BR /&gt;In the .profile I was using an undefined variable causing an error. Nothing following that line was executed.&lt;BR /&gt;&lt;BR /&gt;Once I corrected the error History works fine. Is this also default behaviour, shouldn't the shell continue parsing .profile despite the error?&lt;BR /&gt;&lt;BR /&gt;... and thanks again Massimo for giving insight w.r.t working.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;-Alvi</description>
      <pubDate>Mon, 11 Aug 2003 09:19:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-queries/m-p/3045973#M812735</guid>
      <dc:creator>Omar Alvi_1</dc:creator>
      <dc:date>2003-08-11T09:19:16Z</dc:date>
    </item>
  </channel>
</rss>

