On Jan 18, 2008 6:23 PM, Stefano Sabatini
<[EMAIL PROTECTED]> wrote:
>
> On date Friday 2008-01-18 12:38:21 +0100, Axel Liljencrantz wrote:
> > On Jan 18, 2008 11:01 AM, Stefano Sabatini
> > <[EMAIL PROTECTED]> wrote:
> > > Hi all,
> > >
> > > this is my first post here, so I would like to thank Axel and the
> > > other good guys for the excellent bits.
> > >
> > > I'm facing this problem (I was trying to write a completion file and
> > > stumbled on this, sorry for the eventual naivety, I'm a just a little
> > > fish newbie ;-)):
> > >
> > > [EMAIL PROTECTED] ~/./f/completions> fish -v
> > > fish, version 1.22.3
> > > [EMAIL PROTECTED] ~/./f/completions> set -l list (echo foo bar foobar 
> > > barfoo)
> > > [EMAIL PROTECTED] ~/./f/completions> echo $list
> > > foo bar foobar barfoo
> > >
> > > Allright, but:
> > >
> > > [EMAIL PROTECTED] ~/./f/completions> set -l list (echo \
> > >                                     foo \
> > >                                     bar \
> > >                                     foobar \
> > >                                     barfoo \
> > >                                     )
> > > fish: Unknown command "foo"
> > > in command substitution
> > >         called on standard input,
> > >
> > > fish: Unknown command "bar"
> > > in command substitution
> > >         called on standard input,
> > >
> > > fish: Unknown command "foobar"
> > > in command substitution
> > >         called on standard input,
> > >
> > > fish: Unknown command "barfoo"
> > > in command substitution
> > >         called on standard input,
> > >
> > > Which is the supposed way to escape newlines?
> > >
> >
> > \n
> >
> > set -l list (echo foo\nbar\nfoobar\nbarfoo)
> >
> > Backslash escapes (\t, \r, e), hexadecimal escapes (\x1b), unicode
> > escapes (\u202f, \Udeadbeef) and control sequence escapes (\ca) also
> > work.
> >
> > Hope this helps!
>
> Hi Axel, and thanks for your fast reply!
>
> No, I really meant to ask how to _un_escape newlines, that is how to
> achieve something like this in @#sh:
>
> $ echo foo \
> bar \
> foobar
> foo bar foobar
>
> which in fish will issue:
> [EMAIL PROTECTED] ~> echo foo \
>                     bar \
>                     foobar
> foo
> fish: Unknown command "bar"
> fish: Unknown command "foobar"
>
> Why do I want to achieve it?
> Simply for a reason of readability, I prefer it to
> echo foo bar foobar barf ...
>
> Hope it is clearer my problem now (at least if it is worth the trouble...).
>

I think so. This should work:

$ echo "foo
bar
foobar
foo bar foobar"

Is that what you're aiming for or am I still misunderstanding you?

Axel

>
> TIA, regards.
> --
> Stefano Sabatini
> Linux user number 337176 (see http://counter.li.org)
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Fish-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/fish-users
>

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Fish-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fish-users

Reply via email to