<?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: text or binary file in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/text-or-binary-file/m-p/3472833#M849572</link>
    <description>The file command gives you the attributes of the file.&lt;BR /&gt;&lt;BR /&gt;Try this:&lt;BR /&gt;&lt;BR /&gt;file /usr/bin/scp&lt;BR /&gt;&lt;BR /&gt;answer includes the word binary&lt;BR /&gt;&lt;BR /&gt;file /etc/issue&lt;BR /&gt;&lt;BR /&gt;answer includes the word text&lt;BR /&gt;&lt;BR /&gt;You should be able to run through a lot of files and find what you need. This seems like a security scan of some sort.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
    <pubDate>Thu, 27 Jan 2005 13:05:43 GMT</pubDate>
    <dc:creator>Steven E. Protter</dc:creator>
    <dc:date>2005-01-27T13:05:43Z</dc:date>
    <item>
      <title>text or binary file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/text-or-binary-file/m-p/3472830#M849569</link>
      <description>Hi everyone,&lt;BR /&gt;&lt;BR /&gt;I would like to write a script that search for restricted word such as 'PASSWORD' in text file not executable or binary file.&lt;BR /&gt;&lt;BR /&gt;How do I tell if the file is binary or text?&lt;BR /&gt;&lt;BR /&gt;I plan to use find and grep command to navigate through directories to search for word password.&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;BR /&gt;</description>
      <pubDate>Thu, 27 Jan 2005 12:19:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/text-or-binary-file/m-p/3472830#M849569</guid>
      <dc:creator>Ridzuan Zakaria</dc:creator>
      <dc:date>2005-01-27T12:19:33Z</dc:date>
    </item>
    <item>
      <title>Re: text or binary file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/text-or-binary-file/m-p/3472831#M849570</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;from another forum solutions.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=368008" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=368008&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Hope this helps.&lt;BR /&gt;&lt;BR /&gt;Regds&lt;BR /&gt;</description>
      <pubDate>Thu, 27 Jan 2005 12:23:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/text-or-binary-file/m-p/3472831#M849570</guid>
      <dc:creator>Sanjay_6</dc:creator>
      <dc:date>2005-01-27T12:23:18Z</dc:date>
    </item>
    <item>
      <title>Re: text or binary file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/text-or-binary-file/m-p/3472832#M849571</link>
      <description>Hi,&lt;BR /&gt;use the file command, e.g.:&lt;BR /&gt;# file * | grep text | awk '{print $1}'&lt;BR /&gt; &lt;BR /&gt;regards,&lt;BR /&gt;John K.</description>
      <pubDate>Thu, 27 Jan 2005 12:23:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/text-or-binary-file/m-p/3472832#M849571</guid>
      <dc:creator>john korterman</dc:creator>
      <dc:date>2005-01-27T12:23:52Z</dc:date>
    </item>
    <item>
      <title>Re: text or binary file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/text-or-binary-file/m-p/3472833#M849572</link>
      <description>The file command gives you the attributes of the file.&lt;BR /&gt;&lt;BR /&gt;Try this:&lt;BR /&gt;&lt;BR /&gt;file /usr/bin/scp&lt;BR /&gt;&lt;BR /&gt;answer includes the word binary&lt;BR /&gt;&lt;BR /&gt;file /etc/issue&lt;BR /&gt;&lt;BR /&gt;answer includes the word text&lt;BR /&gt;&lt;BR /&gt;You should be able to run through a lot of files and find what you need. This seems like a security scan of some sort.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Thu, 27 Jan 2005 13:05:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/text-or-binary-file/m-p/3472833#M849572</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2005-01-27T13:05:43Z</dc:date>
    </item>
    <item>
      <title>Re: text or binary file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/text-or-binary-file/m-p/3472834#M849573</link>
      <description>I can suggest a quick and dirty script - take it from there :-)&lt;BR /&gt;&lt;BR /&gt;# vgdisplay 2&amp;gt;/dev/null | grep "VG Name" | awk '{print $3}' | xargs -n1 | while read VG &lt;BR /&gt;do&lt;BR /&gt;   VGNAME=$(echo "$VG" | sed 's/\/dev\///')&lt;BR /&gt;   vgdisplay -v $VG | egrep "LV Name|Current LE" &amp;gt; /root/$VGNAME-LV.list&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;Now once you are done restoring the ignite in the DR server&lt;BR /&gt;&lt;BR /&gt;# for VGS in $(ls  /root/*LV.list)&lt;BR /&gt;do&lt;BR /&gt;  cat VGS | xargs -n2 | while read LV SIZE&lt;BR /&gt;  do&lt;BR /&gt;    VGNAME=$(echo "$VGS" | sed 's/\-LV\.list//')&lt;BR /&gt;    LVNAME=$(echo "$LV" | sed 's/\/dev\/vg.*\///')&lt;BR /&gt;    lvcreate -l $SIZE -n $LVNAME /dev/$VGNAME&lt;BR /&gt;  done&lt;BR /&gt;done&lt;BR /&gt; &lt;BR /&gt;  Remember, the above excerpt will not take care of striping or extend allocation policies or mirroring. But one would assume that is not critical for the DR tests.&lt;BR /&gt;&lt;BR /&gt;  I am not sure the above script is not going to work either :-). &lt;BR /&gt;</description>
      <pubDate>Thu, 27 Jan 2005 13:18:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/text-or-binary-file/m-p/3472834#M849573</guid>
      <dc:creator>Sundar_7</dc:creator>
      <dc:date>2005-01-27T13:18:34Z</dc:date>
    </item>
    <item>
      <title>Re: text or binary file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/text-or-binary-file/m-p/3472835#M849574</link>
      <description>Sorry, the above post is not for you !</description>
      <pubDate>Thu, 27 Jan 2005 13:20:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/text-or-binary-file/m-p/3472835#M849574</guid>
      <dc:creator>Sundar_7</dc:creator>
      <dc:date>2005-01-27T13:20:21Z</dc:date>
    </item>
    <item>
      <title>Re: text or binary file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/text-or-binary-file/m-p/3472836#M849575</link>
      <description>Unfortunately, the file command uses special magic (actually, it uses /etc/magic) to figure out whether a file is text (or dozens of other formats). The problem is that there are NO flags to identify whether a file contains all ASCII (/etc/motd), some ASCII (/etc/lvmtab), or no meaningful ASCII (random data file). The problem with file is that a ps (postscript) file is ASCII, just as an awk program files is ASCII. So looking for  only files that are text will miss hundreds of ASCII files.&lt;BR /&gt; &lt;BR /&gt;What would make more sense is to include only normal files (find ... -type f ...) and then read the files using the strings command and follow that with grep, something like this:&lt;BR /&gt; &lt;BR /&gt;find /etc -type f | while read&lt;BR /&gt;do&lt;BR /&gt;CNT=$(strings $REPLY | grep -c password)&lt;BR /&gt;if [ $CNT -ne 0 ]&lt;BR /&gt;then&lt;BR /&gt;   echo&lt;BR /&gt;   echo $REPLY&lt;BR /&gt;   strings $REPLY | grep password&lt;BR /&gt;fi&lt;BR /&gt;done&lt;BR /&gt; &lt;BR /&gt;You can type all the commands in at the shell prompt or paste them into a file and run the file. Change the first line (find /etc) to find whatever filesystem you are searching. Note that find / is very bad for performance on a multi-user server. It's best to look in likely locations, not in CDROMs, NFS mounted filesystems, database directories, etc.</description>
      <pubDate>Thu, 27 Jan 2005 13:37:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/text-or-binary-file/m-p/3472836#M849575</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2005-01-27T13:37:57Z</dc:date>
    </item>
    <item>
      <title>Re: text or binary file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/text-or-binary-file/m-p/3472837#M849576</link>
      <description>Thank. I am using suggestion by Sanjay.</description>
      <pubDate>Thu, 27 Jan 2005 13:38:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/text-or-binary-file/m-p/3472837#M849576</guid>
      <dc:creator>Ridzuan Zakaria</dc:creator>
      <dc:date>2005-01-27T13:38:13Z</dc:date>
    </item>
  </channel>
</rss>

