[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to echo the output of a shell command and preserve the newlines
From: |
Paul Smith |
Subject: |
Re: How to echo the output of a shell command and preserve the newlines |
Date: |
Tue, 25 Aug 2015 13:37:35 -0400 |
On Tue, 2015-08-25 at 10:28 -0700, Ploppz wrote:
> Hi. I have this line:
> echo "$(shell ~/scripts/make/getshadernames src)" | sed
> 's/\(.*\)/\textern
> char const * const \1;/g' >> src/shaders.h
>
> getshadernames prints out one name on each line. My problem is that
> what is send to sed via the pipe, is only one long line - with
> newlines removed. How can I fix that?
Why are you using the $(shell ...) function in a recipe? The recipe is
already running in a shell!
Why not just:
$$HOME/scripts/make/getshadernames src | sed ... >> src/shaders.h
?
- How to echo the output of a shell command and preserve the newlines, Ploppz, 2015/08/25
- Re: How to echo the output of a shell command and preserve the newlines, Philip Guenther, 2015/08/25
- Re: How to echo the output of a shell command and preserve the newlines,
Paul Smith <=
- Re: How to echo the output of a shell command and preserve the newlines, Ploppz, 2015/08/25
- Re: How to echo the output of a shell command and preserve the newlines, Paul Smith, 2015/08/25
- RE: How to echo the output of a shell command and preserve the newlines, Cook, Malcolm, 2015/08/25
- Re: How to echo the output of a shell command and preserve the newlines, Paul Smith, 2015/08/25
- RE: How to echo the output of a shell command and preserve the newlines, Cook, Malcolm, 2015/08/25