<?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: Disable Copyright text when using command su - in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/disable-copyright-text-when-using-command-su/m-p/4227079#M687557</link>
    <description>Hello Patrik &lt;BR /&gt;&lt;BR /&gt;does adding this to /etc/profile help ? &lt;BR /&gt;(make a copy sign on in two places to test etc. ) &lt;BR /&gt; It should only display it if is on a proper pty  &lt;BR /&gt;&lt;BR /&gt;tty -s &lt;BR /&gt;    if [  $? = 0 ]&lt;BR /&gt;         &lt;BR /&gt;      then&lt;BR /&gt;         cat /etc/copyright&lt;BR /&gt;    fi&lt;BR /&gt; Mike  &lt;BR /&gt;</description>
    <pubDate>Fri, 04 Jul 2008 11:36:12 GMT</pubDate>
    <dc:creator>BUPA IS</dc:creator>
    <dc:date>2008-07-04T11:36:12Z</dc:date>
    <item>
      <title>Disable Copyright text when using command su -</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/disable-copyright-text-when-using-command-su/m-p/4227075#M687553</link>
      <description>Hi!&lt;BR /&gt;&lt;BR /&gt;Does anyone know how i can disable the copyright text that appears when i use the command su - ?&lt;BR /&gt;The text i mean is this one:&lt;BR /&gt;(c)Copyright 1983-2003 Hewlett-Packard Development Company, L.P.&lt;BR /&gt;(c)Copyright 1979, 1980, 1983, 1985-1993 The Regents of the Univ. of California&lt;BR /&gt;(c)Copyright 1980, 1984, 1986 Novell, Inc.&lt;BR /&gt;(c)Copyright 1986-2000 Sun Microsystems, Inc.&lt;BR /&gt;(c)Copyright 1985, 1986, 1988 Massachusetts Institute of Technology&lt;BR /&gt;(c)Copyright 1989-1993  The Open Software Foundation, Inc.&lt;BR /&gt;(c)Copyright 1990 Motorola, Inc.&lt;BR /&gt;(c)Copyright 1990, 1991, 1992 Cornell University&lt;BR /&gt;(c)Copyright 1989-1991 The University of Maryland&lt;BR /&gt;(c)Copyright 1988 Carnegie Mellon University&lt;BR /&gt;(c)Copyright 1991-2003 Mentat Inc.&lt;BR /&gt;(c)Copyright 1996 Morning Star Technologies, Inc.&lt;BR /&gt;(c)Copyright 1996 Progressive Systems, Inc.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;                  RESTRICTED RIGHTS LEGEND&lt;BR /&gt;Use, duplication, or disclosure by the U.S. Government is subject to&lt;BR /&gt;restrictions as set forth in sub-paragraph (c)(1)(ii) of the Rights in&lt;BR /&gt;Technical Data and Computer Software clause in DFARS 252.227-7013.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;                  Hewlett-Packard Company&lt;BR /&gt;                  3000 Hanover Street&lt;BR /&gt;                  Palo Alto, CA 94304 U.S.A.&lt;BR /&gt;&lt;BR /&gt;Rights for non-DOD U.S. Government Departments and Agencies are as set&lt;BR /&gt;forth in FAR 52.227-19(c)(1,2).&lt;BR /&gt;&lt;BR /&gt;Value of TERM has been set to "xterm".&lt;BR /&gt;WARNING:  YOU ARE SUPERUSER !!&lt;BR /&gt;&lt;BR /&gt;Br &lt;BR /&gt;Patrik&lt;BR /&gt;</description>
      <pubDate>Thu, 03 Jul 2008 05:53:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/disable-copyright-text-when-using-command-su/m-p/4227075#M687553</guid>
      <dc:creator>boje</dc:creator>
      <dc:date>2008-07-03T05:53:55Z</dc:date>
    </item>
    <item>
      <title>Re: Disable Copyright text when using command su -</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/disable-copyright-text-when-using-command-su/m-p/4227076#M687554</link>
      <description>See this discussion:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1230173" target="_blank"&gt;http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1230173&lt;/A&gt;</description>
      <pubDate>Thu, 03 Jul 2008 06:00:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/disable-copyright-text-when-using-command-su/m-p/4227076#M687554</guid>
      <dc:creator>Torsten.</dc:creator>
      <dc:date>2008-07-03T06:00:39Z</dc:date>
    </item>
    <item>
      <title>Re: Disable Copyright text when using command su -</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/disable-copyright-text-when-using-command-su/m-p/4227077#M687555</link>
      <description>Hi!&lt;BR /&gt;&lt;BR /&gt;Thank you for the link to the other post. I did search but did not find it. &lt;BR /&gt;I know now that it is illegal to remove this copyright notice. But i think it is a stupid way to show it. When using su - command i scripts, the log starts filling up with these messages: ttytype: couldn't open /dev/tty for reading&lt;BR /&gt;stty: : Not a typewriter&lt;BR /&gt;&lt;BR /&gt;Followed by the whole copyright text. &lt;BR /&gt;&lt;BR /&gt;Br &lt;BR /&gt;Patrik</description>
      <pubDate>Thu, 03 Jul 2008 06:12:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/disable-copyright-text-when-using-command-su/m-p/4227077#M687555</guid>
      <dc:creator>boje</dc:creator>
      <dc:date>2008-07-03T06:12:48Z</dc:date>
    </item>
    <item>
      <title>Re: Disable Copyright text when using command su -</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/disable-copyright-text-when-using-command-su/m-p/4227078#M687556</link>
      <description>Patric,&lt;BR /&gt;&lt;BR /&gt;Its perfectly legal to have it like below.&lt;BR /&gt;&lt;BR /&gt;   1. Copy the file /etc/copyright  to /etc/copyright.txt&lt;BR /&gt;   2. Modify the file /etc/copyright to contain the following text (only): This server software is copyright (C) HP and others. To view the entire copyright notice, use cat /etc/copyright.txt &lt;BR /&gt;&lt;BR /&gt;This will save large text for you...&lt;BR /&gt;&lt;BR /&gt;This was verified with the HP legal department and confirmed it&lt;BR /&gt;complies with the legal requirement. If you have access to KB's,  there is a doc for this.</description>
      <pubDate>Thu, 03 Jul 2008 06:17:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/disable-copyright-text-when-using-command-su/m-p/4227078#M687556</guid>
      <dc:creator>Anshumali</dc:creator>
      <dc:date>2008-07-03T06:17:28Z</dc:date>
    </item>
    <item>
      <title>Re: Disable Copyright text when using command su -</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/disable-copyright-text-when-using-command-su/m-p/4227079#M687557</link>
      <description>Hello Patrik &lt;BR /&gt;&lt;BR /&gt;does adding this to /etc/profile help ? &lt;BR /&gt;(make a copy sign on in two places to test etc. ) &lt;BR /&gt; It should only display it if is on a proper pty  &lt;BR /&gt;&lt;BR /&gt;tty -s &lt;BR /&gt;    if [  $? = 0 ]&lt;BR /&gt;         &lt;BR /&gt;      then&lt;BR /&gt;         cat /etc/copyright&lt;BR /&gt;    fi&lt;BR /&gt; Mike  &lt;BR /&gt;</description>
      <pubDate>Fri, 04 Jul 2008 11:36:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/disable-copyright-text-when-using-command-su/m-p/4227079#M687557</guid>
      <dc:creator>BUPA IS</dc:creator>
      <dc:date>2008-07-04T11:36:12Z</dc:date>
    </item>
    <item>
      <title>Re: Disable Copyright text when using command su -</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/disable-copyright-text-when-using-command-su/m-p/4227080#M687558</link>
      <description>Hi!&lt;BR /&gt;&lt;BR /&gt;I do not understand what this thing does:&lt;BR /&gt;&lt;BR /&gt;tty -s&lt;BR /&gt;if [ $? = 0 ]&lt;BR /&gt;&lt;BR /&gt;then&lt;BR /&gt;cat /etc/copyright&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;If i run a script in crontab, it will not show copyright info? &lt;BR /&gt;&lt;BR /&gt;Br&lt;BR /&gt;Patrik&lt;BR /&gt;</description>
      <pubDate>Fri, 04 Jul 2008 12:32:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/disable-copyright-text-when-using-command-su/m-p/4227080#M687558</guid>
      <dc:creator>boje</dc:creator>
      <dc:date>2008-07-04T12:32:46Z</dc:date>
    </item>
    <item>
      <title>Re: Disable Copyright text when using command su -</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/disable-copyright-text-when-using-command-su/m-p/4227081#M687559</link>
      <description>if crontab is your only problem, then you can redirect the stdout and stderr to /dev/null, like this:&lt;BR /&gt;&lt;BR /&gt;* * * * * /path/to/script.sh &amp;gt;/dev/null 2&amp;gt;&amp;amp;1</description>
      <pubDate>Fri, 04 Jul 2008 12:36:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/disable-copyright-text-when-using-command-su/m-p/4227081#M687559</guid>
      <dc:creator>Oviwan</dc:creator>
      <dc:date>2008-07-04T12:36:54Z</dc:date>
    </item>
    <item>
      <title>Re: Disable Copyright text when using command su -</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/disable-copyright-text-when-using-command-su/m-p/4227082#M687560</link>
      <description>Hello Patrik, &lt;BR /&gt;      The tty command prints the name of the terminal device you are connected to. &lt;BR /&gt;It gives a return code of 0 if it is a terminal. &lt;BR /&gt;If it is not you get a return code of 1, and a 2 if there is some error. &lt;BR /&gt; So the code checks if you are on a terminal and then prints the notice otherwise it does not bother . &lt;BR /&gt;The -s option supresses the terminal name output so that you can use it in a test without getting any output. &lt;BR /&gt;&lt;BR /&gt;$? is the standard environment variable for the return code of the last command. &lt;BR /&gt;&lt;BR /&gt;See man tty for details.&lt;BR /&gt;&lt;BR /&gt;Mike &lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt;</description>
      <pubDate>Fri, 04 Jul 2008 13:02:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/disable-copyright-text-when-using-command-su/m-p/4227082#M687560</guid>
      <dc:creator>BUPA IS</dc:creator>
      <dc:date>2008-07-04T13:02:21Z</dc:date>
    </item>
    <item>
      <title>Re: Disable Copyright text when using command su -</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/disable-copyright-text-when-using-command-su/m-p/4227083#M687561</link>
      <description>&amp;gt;BUPA IS: if [ $? = 0 ]&lt;BR /&gt;&lt;BR /&gt;The proper syntax is: if [ $? -eq 0 ]&lt;BR /&gt;That way it does integer comparisons.&lt;BR /&gt;&lt;BR /&gt;You can also skip tty(1) and just use: if [ -t ]</description>
      <pubDate>Fri, 04 Jul 2008 19:20:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/disable-copyright-text-when-using-command-su/m-p/4227083#M687561</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2008-07-04T19:20:18Z</dc:date>
    </item>
    <item>
      <title>Re: Disable Copyright text when using command su -</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/disable-copyright-text-when-using-command-su/m-p/4227084#M687562</link>
      <description>&amp;gt; the log starts filling up with these messages: ttytype: couldn't open /dev/tty for reading stty: : Not a typewriter&lt;BR /&gt; &lt;BR /&gt;This message and the copyright message are designed only to be read by people. As mentioned before, you must protect your login profiles, both /etc/profile and $HOME/.profile. A script, whether in cron or batch is not connected to a terminal and therefore, no human is there to read or respond to any messages. You must gather *ALL* the terminal commands including the copyright message (and the /etc/motd message if used) into a single part of your profiles, then run these commands when a real terminal exists. Examples of terminal-only commands:&lt;BR /&gt; &lt;BR /&gt;ttytype&lt;BR /&gt;tset&lt;BR /&gt;tput&lt;BR /&gt;stty&lt;BR /&gt;tabs&lt;BR /&gt; &lt;BR /&gt;and anything that is designed for humans to read such as:&lt;BR /&gt; &lt;BR /&gt;cat /etc/copyright&lt;BR /&gt;cat /etc/motd&lt;BR /&gt; &lt;BR /&gt;I am not a lawyer, but I believe that it is not illegal to bypass this /etc/copyright as long as you see the message when the system first starts up, something like the first pages of a book. Another method is to use the notice given in many books and documents, something like this:&lt;BR /&gt; &lt;BR /&gt;print "To read the copyright statement"&lt;BR /&gt;print "type this command: cat /etc/copyright"&lt;BR /&gt; &lt;BR /&gt;But much more important than the copyright message is proper execution of the su - command in cron or batch -- do not run any terminal-only commands under these circumstances.</description>
      <pubDate>Fri, 04 Jul 2008 19:57:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/disable-copyright-text-when-using-command-su/m-p/4227084#M687562</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2008-07-04T19:57:30Z</dc:date>
    </item>
    <item>
      <title>Re: Disable Copyright text when using command su -</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/disable-copyright-text-when-using-command-su/m-p/4227085#M687563</link>
      <description>I'd go one step further than Bill and say that:&lt;BR /&gt;&lt;BR /&gt;su - user -c "..."&lt;BR /&gt;&lt;BR /&gt;Has no place in scripts at all. This instantly places a dependency in the script on the contents of /etc/profile and probably the users .profile, plus .kshrc or .cshrc if other shells are the default shell for a specific user. Thats not good as you don't always know what some other user is going to do with his startup script (for example some people put interactive menus in their login script).&lt;BR /&gt;&lt;BR /&gt;If you need some env variables setting when calling a command as another user, its much better to explicitly set them first and then call su without the "-" which sources the users own environment. So for example a routine to start an Oracle database might go from the dangerous:&lt;BR /&gt;&lt;BR /&gt;su - oracle -c "/usr/local/bin/dbstart"&lt;BR /&gt;&lt;BR /&gt;Which calls everything in /etc/profile and ~oracle/.profile regardless of whether I want or need it, to the much safer and more reliable:&lt;BR /&gt;&lt;BR /&gt;ORACLE_SID=mydb&lt;BR /&gt;ORACLE_HOME=/oracle/10.2&lt;BR /&gt;PATH=${PATH}:${ORACLE_HOME}/bin&lt;BR /&gt;su oracle -c "/usr/local/bin/dbstart"&lt;BR /&gt;&lt;BR /&gt;Which only has the env variables set I know I need to start Oracle.&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;&lt;BR /&gt;Duncan</description>
      <pubDate>Sat, 05 Jul 2008 12:48:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/disable-copyright-text-when-using-command-su/m-p/4227085#M687563</guid>
      <dc:creator>Duncan Edmonstone</dc:creator>
      <dc:date>2008-07-05T12:48:56Z</dc:date>
    </item>
  </channel>
</rss>

