* '\n' equivalent for command input
@ 2017-01-11 18:05 Micael Ramos
2017-01-11 18:08 ` [9front] " Kurt H Maier
2017-01-11 18:30 ` Antons Suspans
0 siblings, 2 replies; 4+ messages in thread
From: Micael Ramos @ 2017-01-11 18:05 UTC (permalink / raw)
To: 9front
[-- Attachment #1: Type: text/plain, Size: 187 bytes --]
There is another representation for newline other than '\n' for standard
input?
When running commands, '\n' is never recognized. Example:
tr '\n' 'newline' < text.txt
Thanks,
Micael.
[-- Attachment #2: Type: text/html, Size: 346 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [9front] '\n' equivalent for command input
2017-01-11 18:05 '\n' equivalent for command input Micael Ramos
@ 2017-01-11 18:08 ` Kurt H Maier
2017-01-11 18:22 ` Micael Ramos
2017-01-11 18:30 ` Antons Suspans
1 sibling, 1 reply; 4+ messages in thread
From: Kurt H Maier @ 2017-01-11 18:08 UTC (permalink / raw)
To: 9front
On Wed, Jan 11, 2017 at 04:05:02PM -0200, Micael Ramos wrote:
> There is another representation for newline other than '\n' for standard
> input?
>
> When running commands, '\n' is never recognized. Example:
>
> tr '\n' 'newline' < text.txt
Look at the manpage for tr(1). Only octal is recognized. Try
tr '\012' 'o'
for instance.
khm
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [9front] '\n' equivalent for command input
2017-01-11 18:08 ` [9front] " Kurt H Maier
@ 2017-01-11 18:22 ` Micael Ramos
0 siblings, 0 replies; 4+ messages in thread
From: Micael Ramos @ 2017-01-11 18:22 UTC (permalink / raw)
To: 9front
[-- Attachment #1: Type: text/plain, Size: 457 bytes --]
Like a charm, thanks Kurt.
2017-01-11 16:08 GMT-02:00 Kurt H Maier <khm@sciops.net>:
> On Wed, Jan 11, 2017 at 04:05:02PM -0200, Micael Ramos wrote:
> > There is another representation for newline other than '\n' for standard
> > input?
> >
> > When running commands, '\n' is never recognized. Example:
> >
> > tr '\n' 'newline' < text.txt
>
> Look at the manpage for tr(1). Only octal is recognized. Try
>
> tr '\012' 'o'
>
> for instance.
>
> khm
>
>
[-- Attachment #2: Type: text/html, Size: 951 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [9front] '\n' equivalent for command input
2017-01-11 18:05 '\n' equivalent for command input Micael Ramos
2017-01-11 18:08 ` [9front] " Kurt H Maier
@ 2017-01-11 18:30 ` Antons Suspans
1 sibling, 0 replies; 4+ messages in thread
From: Antons Suspans @ 2017-01-11 18:30 UTC (permalink / raw)
To: 9front
On Wed, Jan 11, 2017 at 04:05:02PM -0200, Micael Ramos wrote:
> There is another representation for newline other than '\n' for standard input?
>
> When running commands, '\n' is never recognized. Example:
>
> tr '\n' 'newline' < text.txt
>
>
> Thanks,
> Micael.
In rc shell you can use a literal linefeed, too:
tr '
' n
or store it in a variable instead:
lf = '
'
echo foo^$lf^bar^$lf^baz
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-01-11 18:30 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-11 18:05 '\n' equivalent for command input Micael Ramos
2017-01-11 18:08 ` [9front] " Kurt H Maier
2017-01-11 18:22 ` Micael Ramos
2017-01-11 18:30 ` Antons Suspans
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).