Sponsored Content
Full Discussion: A string in a binary file
Operating Systems Solaris A string in a binary file Post 302763343 by zazzybob on Tuesday 29th of January 2013 11:43:32 PM
Old 01-30-2013
Solaris 10 may also have ggrep (i.e. GNU grep - depending on the actual Update of Solaris 10) under /usr/sfw/bin.

Code:
$ uname -rsv
SunOS 5.10 Generic_147441-01
$ cat /etc/release
                    Oracle Solaris 10 8/11 s10x_u10wos_17b X86
  Copyright (c) 1983, 2011, Oracle and/or its affiliates. All rights reserved.
                            Assembled 23 August 2011
$ /usr/sfw/bin/ggrep -a -l "GNU" /usr/sfw/bin/ggrep
/usr/sfw/bin/ggrep
$ /usr/sfw/bin/ggrep -a "GNU" /usr/sfw/bin/ggrep
%s (GNU grep) %s
$ /usr/sfw/bin/ggrep "GNU" /usr/sfw/bin/ggrep
Binary file /usr/sfw/bin/ggrep matches

As you can see, you can use the -a option to treat all files as ascii text, and -l to just list the filename that matches. Leave off the -l to print the actual line that matches.

Cheers,
ZB
 

10 More Discussions You Might Find Interesting

1. Programming

binary to string conversion and vice versa

please let me know that in unix using c programming language we can do binary to string conversion and vice versa using ltoa and atol but how can we do it in c++ programming language. thank you in advance. (3 Replies)
Discussion started by: kinnaree
3 Replies

2. Shell Programming and Scripting

replace string in binary file

Dear all, How can replace special string with another string in binary file? Thanks&Best Regards (2 Replies)
Discussion started by: sg1207
2 Replies

3. Solaris

compiled binary file gives "cannot execute binary file"

Hi, I have two Solaris machines. 1. SunOS X 5.8 Generic_108528-29 sun4u sparc SUNW,Sun-Blade-1500 2. SunOS Y 5.8 Generic_108528-13 sun4u sparc SUNW,Ultra-60 I am trying to buiild a project on both these machines. The Binary output file compiled on machine 2 runs on both the machines. Where... (0 Replies)
Discussion started by: scgupta
0 Replies

4. Shell Programming and Scripting

Split a binary file into 2 basing on 2 delemiter string

Hi all, I have a binary file (orig.dat) and two special delimiter strings 'AAA' and 'BBB'. My binary file's content is as follow: <Data1.1>AAA<Data1.2>BBB <Data2.1>AAA<Data2.2>BBB ... <DataN.1>AAA<DataN.2>BBB DataX.Y might have any length, and contains any kind of special/printable... (1 Reply)
Discussion started by: Averell
1 Replies

5. Shell Programming and Scripting

How to search for string and return binary result?

Hi, I have a problem that I am sure someone will know the answer to. Currently I have a script which returns a binary output if it finds a certain search string (in this case relating to a DRBD cluster) as follows: searchstring="cs:Connected st:Primary/Secondary ds:UpToDate/UpToDate" && echo... (3 Replies)
Discussion started by: almightybunghol
3 Replies

6. UNIX for Advanced & Expert Users

Insert string in binary file at top

How can i append a EBCDIC string of 100 bytes to 0th position of a binary file in UNIX. (4 Replies)
Discussion started by: param_it
4 Replies

7. Shell Programming and Scripting

split a string and convert to binary

Hi All, Iam new to unix scripting and I want a split a string into 4 characters each, leaving the last two characters and convert the splitted values into binary. For example: string='ffd80012ffe20000ffebfffeffea0007fff0ffd70014fff1fff0fff0fff201' this should split as ffd8 0012 ffe2 . .... (5 Replies)
Discussion started by: srinivasayedla
5 Replies

8. Shell Programming and Scripting

Output redirection of c binary file to a file in shell script is failing

I am struck up with a problem and that is with output redirection. I used all the ways for the redirection of the output of c binary to a file, still it is failing. Here are the different ways which I have used: ./a.out | tee -a /root/tmp.txt 2>&1 ./a.out | tee -a /root/tmp.txt 1>&1 ./a.out |... (2 Replies)
Discussion started by: Maya29988
2 Replies

9. Shell Programming and Scripting

Convert binary file to csv and then back to the binary format

Hello *nix specialists, Im working for a non profit organisation in Germany to transport DSL over WLAN to people in areas without no DSL. We are using Linksys WRT 54 router with DD-WRT firmware There are at the moment over 180 router running but we have to change some settings next time. So my... (7 Replies)
Discussion started by: digidax
7 Replies

10. Programming

C program to read a binary file and search for a string?

Hi, I am not a C programmer. The only C exposure I have is reading and completing the exercises from the C (ANSI C ) Programming Language book:o At the moment, I am using the UNIX strings command to extract information for a binary file and grepping for a particular string and the value... (3 Replies)
Discussion started by: newbie_01
3 Replies
libusb(3LIB)							Interface Libraries						      libusb(3LIB)

NAME
libusb - user-space USB device management library SYNOPSIS
cc [ flag... ] -I/usr/sfw/include file... -L/usr/sfw/lib -R/usr/sfw/lib -lusb [ library... ] #include <usb.h> DESCRIPTION
The libusb library contains interfaces for managing USB devices without a kernel driver. It is an open-source API supported on Linux, Mac- OS X, and NetBSD. See http://libusb.sourceforge.net. The current implementation is version 0.1.8 of the libusb API. Complete documentation for this library can be found at /usr/sfw/share/doc/libusb/libusb.txt. INTERFACES
The shared object libusb.so.1 provides the following public interfaces. See intro(3) for additional information on shared object inter- faces. usb_bulk_read usb_bulk_write usb_claim_interface usb_clear_halt usb_close usb_control_msg usb_find_busses usb_find_devices usb_get_busses usb_get_descriptor_by_endpoint usb_get_descriptor usb_get_string usb_get_string_simple usb_init usb_interrupt_read usb_interrupt_write usb_open usb_release_interface usb_reset usb_resetep usb_set_altinterface usb_set_configuration usb_set_debug usb_strerror FILES
/usr/sfw/lib/libusb.so.1 shared object /usr/sfw/lib/libusb_plugins implementation-specific libusb modules /usr/sfw/bin/libusb-config script to determine linking environment ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWlibusb, SUNWlibusbut, | | |SUNWlibugenusb | +-----------------------------+-----------------------------+ |Interface Stability |External | +-----------------------------+-----------------------------+ |MT-Level |Unsafe | +-----------------------------+-----------------------------+ SEE ALSO
intro(3), attributes(5) http://libusb.sourceforge.net SunOS 5.10 14 Oct 2004 libusb(3LIB)
All times are GMT -4. The time now is 11:50 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy