On 9/16/05, <b class="gmail_sendername">Byron L. Sonne</b> <<a href="mailto:blsonne-bJEeYj9oJeDQT0dZR+AlfA@public.gmane.org">blsonne-bJEeYj9oJeDQT0dZR+AlfA@public.gmane.org</a>> wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hey All,<br><br>Not sure where else to turn, so I thought I'd ask you folks. I'm looking<br>to dig up information about how much I can rely on the presence of<br>strings and grep being present on some of the other unices out there,
<br>such as AIX, HPUX, DGUX, etc. Older versions too. In some cases, egrep<br>is present and grep is not.<br><br>If anyone has any info, I'd love to hear it.</blockquote><div><br>
You may be able to access busybox, the "Swiss Army Knife of Embedded
Linux". Just called busybox with grep as the first argument and go from
there. I'm looking at the man page for version 1.00-rc1, and the grep
that it does is documented as follows:<br>
<br>
grep<br>
grep [-ihHnqvs] PATTERN [FILEs...]<br>
<br>
Search for PATTERN in each FILE or standard input.<br>
<br>
Options:<br>
<br>
-H prefix output lines with filename
where match was found<br>
-h suppress the prefixing filename on
output<br>
-i ignore case distinctions<br>
-l list names of files that match<br>
-n print line number with output lines<br>
-q be quiet. Returns 0 if result was
found, 1 otherwise<br>
-v select non-matching lines<br>
-s suppress file open/read error messages<br>
<br>
Example:<br>
<br>
$ grep root /etc/passwd<br>
root:x:0:0:root:/root:/bin/bash<br>
$ grep ^[rR]oo. /etc/passwd<br>
root:x:0:0:root:/root:/bin/bash<br>
<br>
That's not all the functionality of the original, but it might be enough for you. The strings document is:<br>
<br>
strings<br>
strings [-afo] [-n length] [file ... ]<br>
<br>
Display printable strings in a binary file.<br>
<br>
Options:<br>
<br>
-f Precede each string with the name of
the file where it was found.<br>
-n N Specifies that at least N characters forms a
sequence (default 4)<br>
-o Each string is preceded by its decimal
offset in the file.<br>
<br>
</div>The bad news is that busybox is new, so may not be on old systems.<br>
<br>
Alex<br>
<br>
</div>-- <br>----------<br>Linux, Firefox and GMail .. what a combination.