You have two options here.

One, is you execute a shell, and just tell the shell to run your command,
eg bash -c "strings dynamic_file_path | grep regex".

The other option is that you exec strings and grep independently, and
connect the two of them using an os.pipe, but it's a lot more work to do
this and get exiting working properly - you must close the pipe when either
side has an error, etc.



On Wed, Aug 12, 2020 at 8:41 AM thatipelli santhosh <
santhoshthatipelli...@gmail.com> wrote:

> Hi all,
>
> I have requirement to execute a command like cmd : *strings
> dynamic_file_path | grep regex*
>
> I don't know what is the best way to do this like any well known library
> or standard way.
>
> Can you please help here?
>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/CAN1Sb7y2DdZJP30cfxRKr%3DFKgFsc1Kp%2Bdzqe0pd3qAt4JDg6LQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/golang-nuts/CAN1Sb7y2DdZJP30cfxRKr%3DFKgFsc1Kp%2Bdzqe0pd3qAt4JDg6LQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CA%2Bv29LsnJHJrULbeb9VJjMh2mbLaArWM4uvuBH6fqLCAs0B8_A%40mail.gmail.com.

Reply via email to