<?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: read only cat in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/read-only-cat/m-p/2996914#M125622</link>
    <description>What are you really trying to do here?&lt;BR /&gt;&lt;BR /&gt;view the file&lt;BR /&gt;cat file&lt;BR /&gt;&lt;BR /&gt;append to the file&lt;BR /&gt;cat &amp;gt;&amp;gt; file&lt;BR /&gt;&lt;BR /&gt;clear the file&lt;BR /&gt;&amp;gt; file</description>
    <pubDate>Fri, 13 Jun 2003 13:27:18 GMT</pubDate>
    <dc:creator>Kevin Wright</dc:creator>
    <dc:date>2003-06-13T13:27:18Z</dc:date>
    <item>
      <title>read only cat</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/read-only-cat/m-p/2996909#M125617</link>
      <description>I am looking for a tool that does not have the power of cat.&lt;BR /&gt;&lt;BR /&gt;cat &amp;gt; myfile, will flush the contents of myfile. &lt;BR /&gt;&lt;BR /&gt;Is there anything other than more, more does'nt cut it as it stops when the terminal X limit.</description>
      <pubDate>Fri, 13 Jun 2003 13:17:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/read-only-cat/m-p/2996909#M125617</guid>
      <dc:creator>Donny Jekels</dc:creator>
      <dc:date>2003-06-13T13:17:10Z</dc:date>
    </item>
    <item>
      <title>Re: read only cat</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/read-only-cat/m-p/2996910#M125618</link>
      <description>The problem is not cat but rather the shell. Change your "&amp;gt;" to "&amp;gt;&amp;gt;" which will append rather than create/truncate.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 13 Jun 2003 13:22:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/read-only-cat/m-p/2996910#M125618</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2003-06-13T13:22:57Z</dc:date>
    </item>
    <item>
      <title>Re: read only cat</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/read-only-cat/m-p/2996911#M125619</link>
      <description>try:&lt;BR /&gt;&lt;BR /&gt;for $i in filename&lt;BR /&gt;do&lt;BR /&gt; echo $i&lt;BR /&gt;done</description>
      <pubDate>Fri, 13 Jun 2003 13:24:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/read-only-cat/m-p/2996911#M125619</guid>
      <dc:creator>Bill McNAMARA_1</dc:creator>
      <dc:date>2003-06-13T13:24:33Z</dc:date>
    </item>
    <item>
      <title>Re: read only cat</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/read-only-cat/m-p/2996912#M125620</link>
      <description>Hi,&lt;BR /&gt;the problem in not with cat but with myfile.&lt;BR /&gt;&lt;BR /&gt;if you use that command, and you can trim the file, it's a choice of yours.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;If you want a command to view the content of the file, just use "view FILENAME", it should do the work.&lt;BR /&gt;&lt;BR /&gt;There are other commands, like "page", if you want read-only mode.&lt;BR /&gt;&lt;BR /&gt;If the problem is the terminal, ou must first specify which kind of terminal you have, woth a sintax like&lt;BR /&gt;&lt;BR /&gt;"export TERM=xterm"&lt;BR /&gt;&lt;BR /&gt;and then&lt;BR /&gt;&lt;BR /&gt;"resize"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;  Massimo&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 13 Jun 2003 13:25:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/read-only-cat/m-p/2996912#M125620</guid>
      <dc:creator>Massimo Bianchi</dc:creator>
      <dc:date>2003-06-13T13:25:37Z</dc:date>
    </item>
    <item>
      <title>Re: read only cat</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/read-only-cat/m-p/2996913#M125621</link>
      <description>also If you permissions are setup correctly then &lt;BR /&gt;cat &amp;gt; myfile &lt;BR /&gt;will not overwrite myfile&lt;BR /&gt;&lt;BR /&gt;you could also use grep&lt;BR /&gt;&lt;BR /&gt;grep . myfile&lt;BR /&gt;this will display the contents of myfile&lt;BR /&gt;&lt;BR /&gt;however if you redirect any output using &amp;gt; to a file it will overwrite it</description>
      <pubDate>Fri, 13 Jun 2003 13:27:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/read-only-cat/m-p/2996913#M125621</guid>
      <dc:creator>John Meissner</dc:creator>
      <dc:date>2003-06-13T13:27:05Z</dc:date>
    </item>
    <item>
      <title>Re: read only cat</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/read-only-cat/m-p/2996914#M125622</link>
      <description>What are you really trying to do here?&lt;BR /&gt;&lt;BR /&gt;view the file&lt;BR /&gt;cat file&lt;BR /&gt;&lt;BR /&gt;append to the file&lt;BR /&gt;cat &amp;gt;&amp;gt; file&lt;BR /&gt;&lt;BR /&gt;clear the file&lt;BR /&gt;&amp;gt; file</description>
      <pubDate>Fri, 13 Jun 2003 13:27:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/read-only-cat/m-p/2996914#M125622</guid>
      <dc:creator>Kevin Wright</dc:creator>
      <dc:date>2003-06-13T13:27:18Z</dc:date>
    </item>
    <item>
      <title>Re: read only cat</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/read-only-cat/m-p/2996915#M125623</link>
      <description>if your looking to cature STDIN,STDOUT and STDERR consider using script.</description>
      <pubDate>Fri, 13 Jun 2003 13:28:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/read-only-cat/m-p/2996915#M125623</guid>
      <dc:creator>Bill McNAMARA_1</dc:creator>
      <dc:date>2003-06-13T13:28:02Z</dc:date>
    </item>
    <item>
      <title>Re: read only cat</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/read-only-cat/m-p/2996916#M125624</link>
      <description>Another useful command is "tee".&lt;BR /&gt;&lt;BR /&gt;tee -a myfile will echo stdin to stdout and append the stdin to myfile. You can actually see what you are doing with this command. Man tee for details.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 13 Jun 2003 13:34:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/read-only-cat/m-p/2996916#M125624</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2003-06-13T13:34:31Z</dc:date>
    </item>
    <item>
      <title>Re: read only cat</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/read-only-cat/m-p/2996917#M125625</link>
      <description>thanks all,&lt;BR /&gt;&lt;BR /&gt;The "grep . &lt;FILENAME&gt;" is what I was looking for.&lt;BR /&gt;&lt;BR /&gt;maybe my question was to poetic.&lt;BR /&gt;&lt;BR /&gt;but I want to remsh in to a bunch of machines and send the contents of any file to STDOUT.&lt;BR /&gt;&lt;BR /&gt;cat is way too dangerous.&lt;BR /&gt;&lt;BR /&gt;peace&lt;BR /&gt;Donny&lt;BR /&gt;&lt;/FILENAME&gt;</description>
      <pubDate>Fri, 13 Jun 2003 13:44:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/read-only-cat/m-p/2996917#M125625</guid>
      <dc:creator>Donny Jekels</dc:creator>
      <dc:date>2003-06-13T13:44:00Z</dc:date>
    </item>
    <item>
      <title>Re: read only cat</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/read-only-cat/m-p/2996918#M125626</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;If you are interested in protecting your file from inadvertant overwrite, you can set the "noclobber" option.  See the man pages for 'sh_posix' for more details.  &lt;BR /&gt;&lt;BR /&gt;Consider:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;exec 2&amp;gt; /dev/null&lt;BR /&gt;trap 'echo Attempted overwrite denied' ERR&lt;BR /&gt;echo "bang! at `date`" &amp;gt; /tmp/mylog&lt;BR /&gt;exit 0&lt;BR /&gt;&lt;BR /&gt;Call the script "my.sh" and run it like:&lt;BR /&gt;&lt;BR /&gt;# ./my.sh&lt;BR /&gt;&lt;BR /&gt;Now run it with the 'noclobber' option:&lt;BR /&gt;&lt;BR /&gt;# sh -C ./my.sh&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Fri, 13 Jun 2003 13:45:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/read-only-cat/m-p/2996918#M125626</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2003-06-13T13:45:53Z</dc:date>
    </item>
    <item>
      <title>Re: read only cat</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/read-only-cat/m-p/2996919#M125627</link>
      <description>I don't see what you mean by "cat is too dangerous".&lt;BR /&gt;&lt;BR /&gt;Cat simply 'concatenates' a file. Your redirection is what can be dangerous. Whether you use cat or your grep ., if you want to save STDOUT into a file, you still need to redirect the output!&lt;BR /&gt;&lt;BR /&gt;remsh host "cat file" &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 13 Jun 2003 14:21:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/read-only-cat/m-p/2996919#M125627</guid>
      <dc:creator>Kevin Wright</dc:creator>
      <dc:date>2003-06-13T14:21:57Z</dc:date>
    </item>
    <item>
      <title>Re: read only cat</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/read-only-cat/m-p/2996920#M125628</link>
      <description>As mentioned, cat is not a problem, it is redirection that is the problem. When you remsh to another machine, it is important to understand just where redirection will go. Consider these two commands:&lt;BR /&gt;&lt;BR /&gt;remsh cpu1 cat /etc/passwd &amp;gt; /var/tmp/pw&lt;BR /&gt;remsh cpu1 cat /etc/passwd \&amp;gt; /var/tmp/pw&lt;BR /&gt;&lt;BR /&gt;This will list the contents of /etc/passwd from the remote system called cpu1 and place in the local file /var/tmp/pw. The second line, however, will copy the file inside the remote server and the copy stays on the remote server. There is only one character different and that is the escape for &amp;gt;. The shell sees &amp;gt; and interprets it as a redirection symbol. With \&amp;gt;, the shell is told to ignore the redirection and the entire string is sent to the remote system.&lt;BR /&gt;&lt;BR /&gt;It sounds like you need to write specific scripts to accomplish the needed tasks and debug how the data is being redirected. grep or any other command is just as dangerous as cat when you don't get redirection properly defined.</description>
      <pubDate>Fri, 13 Jun 2003 14:59:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/read-only-cat/m-p/2996920#M125628</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2003-06-13T14:59:36Z</dc:date>
    </item>
    <item>
      <title>Re: read only cat</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/read-only-cat/m-p/2996921#M125629</link>
      <description>Kevin, yes you are absolutely correct. cat is just cat rihgt.&lt;BR /&gt;&lt;BR /&gt;however been burnt before with remsh and executing the most obvious commands such as &lt;BR /&gt;&lt;BR /&gt;for x in serv1 serv2 ... serv100&lt;BR /&gt;do&lt;BR /&gt;echo $x&lt;BR /&gt;remsh $x "cp /etc/passwd /tmp/passwrd.orig"&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;from anyones viewpoint this is a strait forward copy.&lt;BR /&gt;&lt;BR /&gt;however for some unknown reason 10 of the boxes lost the password contents - and no-one could explain why.&lt;BR /&gt;&lt;BR /&gt;one bitten twice shy&lt;BR /&gt;&lt;BR /&gt;peace&lt;BR /&gt;Donny</description>
      <pubDate>Fri, 13 Jun 2003 17:29:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/read-only-cat/m-p/2996921#M125629</guid>
      <dc:creator>Donny Jekels</dc:creator>
      <dc:date>2003-06-13T17:29:49Z</dc:date>
    </item>
    <item>
      <title>Re: read only cat</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/read-only-cat/m-p/2996922#M125630</link>
      <description>Well, that is an interesting issue. I don't know what happened to cause your passwd file to be nulled out.&lt;BR /&gt;&lt;BR /&gt;You may want to log all input/output/error of your commands&lt;BR /&gt;&lt;BR /&gt;remsh $x 'cp passwd passwd.orig &amp;gt; /tmp/cp.log 2&amp;gt;&amp;amp;1' or something to that effect&lt;BR /&gt;&lt;BR /&gt;Or like Bill mentioned, log all STDOUT and ERR to a local log file.</description>
      <pubDate>Fri, 13 Jun 2003 18:11:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/read-only-cat/m-p/2996922#M125630</guid>
      <dc:creator>Kevin Wright</dc:creator>
      <dc:date>2003-06-13T18:11:42Z</dc:date>
    </item>
    <item>
      <title>Re: read only cat</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/read-only-cat/m-p/2996923#M125631</link>
      <description>well, you can't blame for not trusting remsh now can you.&lt;BR /&gt;&lt;BR /&gt;anyway, thanx for the advise. personnaly I like the grep method.&lt;BR /&gt;&lt;BR /&gt;peace&lt;BR /&gt;Donny</description>
      <pubDate>Fri, 13 Jun 2003 22:57:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/read-only-cat/m-p/2996923#M125631</guid>
      <dc:creator>Donny Jekels</dc:creator>
      <dc:date>2003-06-13T22:57:23Z</dc:date>
    </item>
  </channel>
</rss>

