[Nix-dev] How to escape $'\t' in Nix multi-line string?

Profpatsch mail at profpatsch.de
Sun Apr 30 19:53:16 CEST 2017


On 17-04-30 03:07pm, Bjørn Forsman wrote:
> On 30 April 2017 at 15:01, Bjørn Forsman <bjorn.forsman at gmail.com> wrote:
> > Hi all,
> >
> > I'm stuck trying to pass $'\t' to bash via Nix multi-line strings:
> >
> > nix-repl> ''cut -d $'\t' -f 1''
> > error: syntax error, unexpected $undefined, expecting IND_STR or
> > DOLLAR_CURLY or IND_STRING_CLOSE, at (string):1:10
> 
> Oh, it was only missing double single-quotes before the dollar sign.
> 
> What tripped me was that the documentation says ${ is special in
> strings, not $'.

How should we improve the manual in this regard?

-- 
Proudly written in Mutt with Vim on NixOS.
Q: Why is this email five sentences or less?
A: http://five.sentenc.es
May take up to five days to read your message. If it’s urgent, call me.


More information about the nix-dev mailing list