[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: |
Philip Guenther |
Subject: |
Re: How to echo the output of a shell command and preserve the newlines |
Date: |
Tue, 25 Aug 2015 10:37:37 -0700 |
On Tue, Aug 25, 2015 at 10:28 AM, Ploppz <address@hidden> 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?
Uh, why are you using echo and $(shell) there instead of just
~/scripts/make/getshadernames src | sed 's/\(.*\)/\textern
char const * const \1;/g' >> src/shaders.h
?
Philip Guenther
- 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 <=
- 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, 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