Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.user > #268810
| From | <tomas@tuxteam.de> |
|---|---|
| Newsgroups | linux.debian.user |
| Subject | Re: config files - newline possible? |
| Date | 2024-04-11 20:30 +0200 |
| Message-ID | <Is7ln-5ClR-9@gated-at.bofh.it> (permalink) |
| References | <Is50d-5APD-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
[Multipart message — attachments visible in raw view] - view raw
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
Back to linux.debian.user | Previous | Next — Next in thread | Find similar | Unroll thread
Re: config files - newline possible? <tomas@tuxteam.de> - 2024-04-11 20:30 +0200
Re: config files - newline possible? Greg Wooledge <greg@wooledge.org> - 2024-04-11 20:50 +0200
[SOLVED] Re: config files - newline possible? Hans <hans.ullrich@loop.de> - 2024-04-11 21:40 +0200
Re: config files - newline possible? Hans <hans.ullrich@loop.de> - 2024-04-11 20:50 +0200
csiph-web