On Thu, Apr 11, 2024 at 05:56:05PM +0200, Hans wrote:
Hi folks,
O know in shell scripts it is possible, to seperate a looong line of commands
into several short lines.
But can this be done in config-files, too?
I have a files with the syntax like this:
Do_not_write="/path1/subfolder /path1/subfolder2 ... /pathX/subfolderX"
As Nicolas George says, "config-file" is too generic a term.
If the above is a variable assignment, then you can escape the
newlines with a backslash, like so
Do_not_write="path1/subfolder \
path1/subfolder2 \
..."
Note that the backslash has to be the last character in the
line. No extra whitespace after that (this is somewhat
fragile). I prefer to put such things in here docs:
read -d '' Do_not_write <<"__END"
this
that
the other
__END
echo "Do_not_write"
this
that
the other
Put attention to the quotes. In bash, type "help read" to learn
about the options (it is a builtin, it has to).
Cheers
--
t
-----BEGIN PGP SIGNATURE-----
iF0EABECAB0WIQRp53liolZD6iXhAoIFyCz1etHaRgUCZhgquwAKCRAFyCz1etHa RuCBAJ418uS1p0/sA5pUmK/wPJeLlNJcbACeJ5x0dF3w/vgryHQjoNkyxAuNuk4=
=dPm2
-----END PGP SIGNATURE-----
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)