But can this be done in config-files, too?
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"
in my case it is the config freom from bootcdwrite, which is bootcdwrite.conf.
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
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 546 |
Nodes: | 16 (2 / 14) |
Uptime: | 08:28:56 |
Calls: | 10,387 |
Calls today: | 2 |
Files: | 14,060 |
Messages: | 6,416,658 |