0

When working with gdb, I often need to redirect the output of a command to the process in gdb. However, I can't do ./script | run in gdb so I often have to pipe the output to a file or named pipe and pipe that file/pipe with run < file.

Is there a way to "left-pipe" the output?

ChocolateOverflow
  • 871
  • 1
  • 8
  • 21
  • 1
    is this strictly related to GDB? if so, I would advise adding the related tags and maybe edit your question so it relate mainly to GDB...(so other answering won't be confuse) – Nordine Lotfi May 16 '21 at 05:54
  • 2
    while I don't know what is the `gdb` (GNU Debugger? still not familiar with it), but maybe this should work for you, `run <(./script)`? using process substitution – αғsнιη May 16 '21 at 06:01
  • similar to @αғsнιη answer, you could try this:https://stackoverflow.com/a/4521023/12349101 – Nordine Lotfi May 16 '21 at 06:26
  • @NordineLotfi This isn't really about gdb. I'm just looking for a way to pipe from right to left instead of the usual `left | right`. Doing `run <(cmd)` doesn't work, and 4521015 is piping a file like `run < file` and not a process stdout. – ChocolateOverflow May 16 '21 at 09:20
  • Does this answer your question? [Redirecting from right to left](https://unix.stackexchange.com/questions/503990/redirecting-from-right-to-left) – Pablo A May 29 '23 at 20:18

0 Answers0