run-shell-command with output

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

run-shell-command with output

Ag Ibragimov

I need to run shell command and collect its output but I can't figure out, for some reason it doesn't get the output. I tried using run-shell-command and run-prog-collect-output, and they either return nil or an empty string.

I'm trying something like this:  `xrandr | grep " connected "`

Can anyone suggest what I might be missing or misconfigured on my system?

Reply | Threaded
Open this post in threaded view
|

Re: run-shell-command with output

Ag Ibragimov
nevermind... running run-shell-command with t flag worked. I'm not sure why it didn't the first time I tried

On Sat 23 May 2020 at 19:05, Ag Ibragimov <[hidden email]> wrote:

> I need to run shell command and collect its output but I can't figure out, for some reason it doesn't get the output. I tried using run-shell-command and run-prog-collect-output, and they either return nil or an empty string.
>
> I'm trying something like this:  `xrandr | grep " connected "`
>
> Can anyone suggest what I might be missing or misconfigured on my system?