<?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 how to get the script file in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-the-script-file/m-p/6989144#M495606</link>
    <description>Whenever i am login/switching user it is executing a script file. But i have no information l about this file ike file location , file contents etc ?&lt;BR /&gt;Suggest me how can get details of dcript file.</description>
    <pubDate>Tue, 21 Nov 2017 09:49:13 GMT</pubDate>
    <dc:creator>pardeep3dec</dc:creator>
    <dc:date>2017-11-21T09:49:13Z</dc:date>
    <item>
      <title>how to get the script file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-the-script-file/m-p/6989144#M495606</link>
      <description>Whenever i am login/switching user it is executing a script file. But i have no information l about this file ike file location , file contents etc ?&lt;BR /&gt;Suggest me how can get details of dcript file.</description>
      <pubDate>Tue, 21 Nov 2017 09:49:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-the-script-file/m-p/6989144#M495606</guid>
      <dc:creator>pardeep3dec</dc:creator>
      <dc:date>2017-11-21T09:49:13Z</dc:date>
    </item>
    <item>
      <title>Re: how to get the script file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-the-script-file/m-p/6989197#M495607</link>
      <description>&lt;P&gt;First, identify which shell is configured for the user in question. In HP-UX, the default shell is the POSIX shell, or (/usr)/bin/sh.&lt;/P&gt;&lt;P&gt;Then, read the man page of the shell in question. In HP-UX, the man page sh(1) is an overview of the various system shells, and the actual man page of the POSIX shell is named "sh-posix". In there, you find a description of what happens when that particular shell is started up. Usually this description is under a heading like "Shell invocation", "INVOCATION" or similar.&lt;/P&gt;&lt;P&gt;"man sh-posix" says:&lt;/P&gt;&lt;BLOCKQUOTE&gt;Shell Invocation&lt;P&gt;If the shell is invoked by an exec&lt;I&gt;*&lt;/I&gt;() system call and the first character of argument zero (shell parameter 0) is dash (-), the shell is assumed to be a login shell and commands are read first from /etc/profile, then from either .profile in the current directory or $HOME/.profile if either file exists, and finally from the file named by performing parameter substitution on the value of the environment parameter ENV, if the file exists. If the -s option is not present and an &lt;I&gt;arg&lt;/I&gt; is, a path search is performed on the first &lt;I&gt;arg&lt;/I&gt; to determine the name of the script to execute. When running &lt;SPAN&gt;&lt;STRONG&gt;sh&lt;/STRONG&gt;&lt;/SPAN&gt; with &lt;I&gt;arg&lt;/I&gt;, the script &lt;I&gt;arg&lt;/I&gt; must have read permission and any setuid and setgid settings will be ignored. Commands are read as described below.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;In other words, with the POSIX sh shell:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&amp;nbsp;if you are actually logging in, or switching users using "su -", the first script executed will be /etc/profile,&lt;/LI&gt;&lt;LI&gt;then $HOME/.profile if it exists.&lt;/LI&gt;&lt;LI&gt;on login or "su -", your current directory will be the user's home directory. If you somehow invoke the shell using the login shell convention in a non-home directory, then the .profile script in that directory may be executed instead of $HOME/.profile. But this would be an unusual case.&lt;/LI&gt;&lt;LI&gt;If the environment variable $ENV is set and points to an existing file, then that file is executed as a script.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;The (/usr)/bin/ksh shell behaves the same as the POSIX sh shell.&lt;/P&gt;&lt;P&gt;The scummy (/usr)/bin/csh shell, on the other hand, executes first /etc/csh.login if you are actually logging in, then $HOME/.login, and finally $HOME/.cshrc. But if you start a sub-shell, it always runs only $HOME/.cshrc and none of the other scripts.&lt;/P&gt;&lt;P&gt;Script files are text files: the system-wide login scripts (/etc/profile and /etc/csh.login) must be readable by anyone. So you can just run a command like&lt;/P&gt;&lt;PRE&gt;more /etc/profile&lt;/PRE&gt;&lt;P&gt;to view them.&lt;/P&gt;&lt;P&gt;Per-user login scripts may or may not be readable to other users; they certainly should not be writeable by anyone other than their owner.&lt;/P&gt;&lt;P&gt;The default versions of per-user scripts, that are copied to each user's home directory as the user account is created, are located in /etc/skel/ directory.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Nov 2017 14:47:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-get-the-script-file/m-p/6989197#M495607</guid>
      <dc:creator>Matti_Kurkela</dc:creator>
      <dc:date>2017-11-21T14:47:44Z</dc:date>
    </item>
  </channel>
</rss>

