<?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: Configuring the user command shell prompt in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/configuring-the-user-command-shell-prompt/m-p/3832949#M778992</link>
    <description>Hi Andrew,&lt;BR /&gt;&lt;BR /&gt;The syntax for assigning a value to an environmental variable is unique in csh:&lt;BR /&gt;&lt;BR /&gt;% set prompt="[`whoami`@`hostname`]:`pwd` % "&lt;BR /&gt;&lt;BR /&gt;Adding this to the global cshrc should work, unless a user's local .cshrc overrides it.&lt;BR /&gt;&lt;BR /&gt;PCS</description>
    <pubDate>Fri, 28 Jul 2006 11:15:22 GMT</pubDate>
    <dc:creator>spex</dc:creator>
    <dc:date>2006-07-28T11:15:22Z</dc:date>
    <item>
      <title>Configuring the user command shell prompt</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/configuring-the-user-command-shell-prompt/m-p/3832945#M778988</link>
      <description>Hi there --&lt;BR /&gt;&lt;BR /&gt;I am running an 11.11 server and would like to have all user prompts at the command shell appear with the directory that the user is currently in at any given time. My plan is to modify the global-cshrc file and/or the users' individual .cshrc files.&lt;BR /&gt;&lt;BR /&gt;My question is, what is the correct syntax to use to accomplish this? Thanks.</description>
      <pubDate>Fri, 28 Jul 2006 10:59:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/configuring-the-user-command-shell-prompt/m-p/3832945#M778988</guid>
      <dc:creator>Andrew Kaplan</dc:creator>
      <dc:date>2006-07-28T10:59:34Z</dc:date>
    </item>
    <item>
      <title>Re: Configuring the user command shell prompt</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/configuring-the-user-command-shell-prompt/m-p/3832946#M778989</link>
      <description>The prompt is stored in variable PS1.&lt;BR /&gt;&lt;BR /&gt;You can search the forum for a lot of solutions or play with it like&lt;BR /&gt;&lt;BR /&gt;export PS1='$PWD &amp;gt;'</description>
      <pubDate>Fri, 28 Jul 2006 11:02:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/configuring-the-user-command-shell-prompt/m-p/3832946#M778989</guid>
      <dc:creator>Torsten.</dc:creator>
      <dc:date>2006-07-28T11:02:35Z</dc:date>
    </item>
    <item>
      <title>Re: Configuring the user command shell prompt</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/configuring-the-user-command-shell-prompt/m-p/3832947#M778990</link>
      <description>For csh, the prompt variable isn't PS1, it's "prompt". So you'd use:&lt;BR /&gt;&lt;BR /&gt;set prompt = "$cwd:t %"</description>
      <pubDate>Fri, 28 Jul 2006 11:13:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/configuring-the-user-command-shell-prompt/m-p/3832947#M778990</guid>
      <dc:creator>Jonathan Fife</dc:creator>
      <dc:date>2006-07-28T11:13:48Z</dc:date>
    </item>
    <item>
      <title>Re: Configuring the user command shell prompt</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/configuring-the-user-command-shell-prompt/m-p/3832948#M778991</link>
      <description>It's very convoluted for csh. (From eons ago when I was working on SunOS 4.X and IRIX 4.X, I used tcsh and there were some nice shortcuts similar to what bash uses to customize the prompt.)&lt;BR /&gt;&lt;BR /&gt;A Google search yielded the following information from the UNIX FAQ (&lt;A href="http://www.faqs.org/faqs/unix-faq/faq/part2/section-4.html)." target="_blank"&gt;http://www.faqs.org/faqs/unix-faq/faq/part2/section-4.html).&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;C Shell (csh):&lt;BR /&gt;&lt;BR /&gt;Put this in your .cshrc - customize the prompt variable the way you want.&lt;BR /&gt;&lt;BR /&gt;alias setprompt 'set prompt="${cwd}% "'&lt;BR /&gt;setprompt        # to set the initial prompt&lt;BR /&gt;alias cd 'chdir \!* &amp;amp;&amp;amp; setprompt'&lt;BR /&gt;        &lt;BR /&gt;If you use pushd and popd, you'll also need&lt;BR /&gt;&lt;BR /&gt;alias pushd 'pushd \!* &amp;amp;&amp;amp; setprompt'&lt;BR /&gt;alias popd  'popd  \!* &amp;amp;&amp;amp; setprompt'&lt;BR /&gt;&lt;BR /&gt;Some C shells don't keep a $cwd variable - you can use `pwd` instead.&lt;BR /&gt;&lt;BR /&gt;If you just want the last component of the current directory in your prompt ("mail% " instead of "/usr/spool/mail% ") you can use&lt;BR /&gt;&lt;BR /&gt;alias setprompt 'set prompt="$cwd:t% "'&lt;BR /&gt;        &lt;BR /&gt;Some older csh's get the meaning of &amp;amp;&amp;amp; and || reversed. Try doing:&lt;BR /&gt;&lt;BR /&gt;false &amp;amp;&amp;amp; echo bug&lt;BR /&gt;&lt;BR /&gt;If it prints "bug", you need to switch &amp;amp;&amp;amp; and || (and get a better version of csh.)</description>
      <pubDate>Fri, 28 Jul 2006 11:15:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/configuring-the-user-command-shell-prompt/m-p/3832948#M778991</guid>
      <dc:creator>Jeff_Traigle</dc:creator>
      <dc:date>2006-07-28T11:15:16Z</dc:date>
    </item>
    <item>
      <title>Re: Configuring the user command shell prompt</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/configuring-the-user-command-shell-prompt/m-p/3832949#M778992</link>
      <description>Hi Andrew,&lt;BR /&gt;&lt;BR /&gt;The syntax for assigning a value to an environmental variable is unique in csh:&lt;BR /&gt;&lt;BR /&gt;% set prompt="[`whoami`@`hostname`]:`pwd` % "&lt;BR /&gt;&lt;BR /&gt;Adding this to the global cshrc should work, unless a user's local .cshrc overrides it.&lt;BR /&gt;&lt;BR /&gt;PCS</description>
      <pubDate>Fri, 28 Jul 2006 11:15:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/configuring-the-user-command-shell-prompt/m-p/3832949#M778992</guid>
      <dc:creator>spex</dc:creator>
      <dc:date>2006-07-28T11:15:22Z</dc:date>
    </item>
    <item>
      <title>Re: Configuring the user command shell prompt</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/configuring-the-user-command-shell-prompt/m-p/3832950#M778993</link>
      <description>Addendum:&lt;BR /&gt;&lt;BR /&gt;$cwd:t gives you just the current directory, but $cwd would give you the full path:&lt;BR /&gt;&lt;BR /&gt;testqa1 1: set prompt = "$cwd:t %"&lt;BR /&gt;fifejj %pwd&lt;BR /&gt;/home/fifejj&lt;BR /&gt;fifejj %set prompt = "$cwd %"&lt;BR /&gt;/home/fifejj %&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 28 Jul 2006 11:16:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/configuring-the-user-command-shell-prompt/m-p/3832950#M778993</guid>
      <dc:creator>Jonathan Fife</dc:creator>
      <dc:date>2006-07-28T11:16:23Z</dc:date>
    </item>
    <item>
      <title>Re: Configuring the user command shell prompt</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/configuring-the-user-command-shell-prompt/m-p/3832951#M778994</link>
      <description>&lt;!--!*#--&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;since I see the string '.cshrc' in your question, I assume C-Shell.&lt;BR /&gt;The prompt is stored in the variable&lt;BR /&gt;$prompt.&lt;BR /&gt;&lt;BR /&gt;This is the entry in .cshrc:&lt;BR /&gt;&lt;BR /&gt;set HOST=`uname -n`&lt;BR /&gt;if ($?prompt &amp;amp;&amp;amp; -f ~/.prompt) then&lt;BR /&gt;        if ("$prompt" != "") source ~/.prompt&lt;BR /&gt;        alias cd        "cd \!*; source ~/.prompt"&lt;BR /&gt;endif&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;This is my ~/.prompt (see attachment for escape-sequences in strings!!) - note that you can drop the CLEARCASE_STUFF if you dont have that Software:&lt;BR /&gt;&lt;BR /&gt;if ( $?prompt ) then&lt;BR /&gt;# better set HOST in .cshrc&lt;BR /&gt;#       set HOST=`hostname`&lt;BR /&gt;        if ( $?CLEARCASE_ROOT ) then&lt;BR /&gt;                if ($?tcsh) then&lt;BR /&gt;                        set icon=${CLEARCASE_ROOT:t}&lt;BR /&gt;                        set ccview=%B${icon}%b:&lt;BR /&gt;                else&lt;BR /&gt;                        set icon=`basename $CLEARCASE_ROOT`&lt;BR /&gt;                        set ccview=${icon}:&lt;BR /&gt;                endif&lt;BR /&gt;        else set ccview= icon=$HOST&lt;BR /&gt;        endif&lt;BR /&gt;        if ( $AKTPROJEKT != "keinProjekteingestellt" ) then&lt;BR /&gt;                set ccview=${AKTPROJEKT}:$ccview&lt;BR /&gt;        endif&lt;BR /&gt;        if ( ($TERM == xterm) || ($TERM == dtterm) ) then&lt;BR /&gt;                set prompt=${LOGNAME}@${HOST}:${ccview}"! "&lt;BR /&gt;                echo -n ""&lt;BR /&gt;        else&lt;BR /&gt;                if ($?tcsh) then&lt;BR /&gt;                        set prompt="${HOST}:${ccview}%~:! "&lt;BR /&gt;                else&lt;BR /&gt;                        set prompt="${HOST}:${ccview}${cwd}:! "&lt;BR /&gt;                endif&lt;BR /&gt;        endif&lt;BR /&gt;endif&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Note that TCSH (Superset of csh) has really nice and usable capabilities, but my prompt takes care of this.&lt;BR /&gt;&lt;BR /&gt;mfG Peter&lt;BR /&gt;</description>
      <pubDate>Fri, 28 Jul 2006 11:21:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/configuring-the-user-command-shell-prompt/m-p/3832951#M778994</guid>
      <dc:creator>Peter Nikitka</dc:creator>
      <dc:date>2006-07-28T11:21:34Z</dc:date>
    </item>
    <item>
      <title>Re: Configuring the user command shell prompt</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/configuring-the-user-command-shell-prompt/m-p/3832952#M778995</link>
      <description>well lots of people told you how to do it. &lt;BR /&gt;&lt;BR /&gt;you can man csh for more details. &lt;BR /&gt;&lt;BR /&gt;Also for what its worth, you should not modify individual users .cshrc files. Personally I would be very annoyed if some admin came along and decided what I needed in my .cshrc file. Let the users tend their own .cshrc files. &lt;BR /&gt;</description>
      <pubDate>Fri, 28 Jul 2006 11:43:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/configuring-the-user-command-shell-prompt/m-p/3832952#M778995</guid>
      <dc:creator>Marvin Strong</dc:creator>
      <dc:date>2006-07-28T11:43:41Z</dc:date>
    </item>
    <item>
      <title>Re: Configuring the user command shell prompt</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/configuring-the-user-command-shell-prompt/m-p/3832953#M778996</link>
      <description>BTW: I'd stick the code in the /etc/csh.login file (global), as you want it for all users.  Just note that an individuals .cshrc could change it</description>
      <pubDate>Fri, 28 Jul 2006 12:07:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/configuring-the-user-command-shell-prompt/m-p/3832953#M778996</guid>
      <dc:creator>OldSchool</dc:creator>
      <dc:date>2006-07-28T12:07:10Z</dc:date>
    </item>
  </channel>
</rss>

