Is same question as How can I have a newline in a string in sh? but in fish shell.
In bash we have:
$'this is line\nthis is another line'
who produces the expected result, but in fish this doesnt works.
fish has a similar way to do this?
Edit 1:
has the literal method wisely mentioned by the faho:
'this is line
this is another line'
But i'm really curious about the existence of a method keeping reference for \n
as line break like in shell.
I want to know if I can use this string "this is a line\nthis is another line"
making sure that the fish will consider \n
as a line break and not a literal.