A
A
Artyom Alexandrov2018-06-08 20:11:41
linux
Artyom Alexandrov, 2018-06-08 20:11:41

How to display the output of utilities called with exec from the script.sh script in the terminal?

#!/bin/bash
cd build
exec cmake ../
exec make
exit 0

How to see the output of cmake.
Only errors are displayed, and I need everything.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
jcmvbkbc, 2018-06-08
@kradwhite

#!/bin/bash
cd build
exec cmake ../
exec make
exit 0

I think you misunderstand how exec works. It replaces the current executable image with a new command. Therefore, two execs in a row do not make sense, because after the first exec bash will turn into a cmake pumpkin . Those. to run first cmake and then make you need to write
#!/bin/bash
cd build
cmake ../
make
exit 0

Otherwise, nothing needs to be changed, in the absence of output redirection (> / >> / >&), the standard output of the parent is inherited by the spawned process.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question