On Wed, Feb 13, 2013 at 08:07:07PM +0100, Lennart Poettering wrote: > On Wed, 13.02.13 20:05, Zbigniew Jędrzejewski-Szmek (zbys...@in.waw.pl) wrote: > > > Actually, the syntax already is _not_ a subset of the shell, and has its > > own pecularities. Anyone trying to blindly follow shell rules is going > > to be severly bitten anyway. So, why not go a bit further and change > > the syntax in a way that is useful for our users? > > It's certainly true that we are not compatible with shell, and that we > aren't even trying to be. But in this regard I see no reason to deviate.
Hi Lennart, variable definitions in a shell is recognized by quotes - in contrast to systemd. For single line definition, there is no problem at all. FOO="blah blah blah" will be parsed in a same way by both + systemd would allow an unquoted version. And there are probably some funny problems with quites inside definition, but this is an another story Taking quotes into an account removes all ambiguities we are facing with a comments and empty lines an so. Let have FOO="multi #commented definition" #followed by a comment BAR="and an another variable" w/o continuation, systemd will create two single lines variables FOO and BAR. This does not work like shell. So lets add some continuations FOO="multi \ #commented \ definition" \ #followed by a comment \ BAR="and an another variable" Well, this is still not correct - now we have FOO and BAR in a shell, where systemd will * see two variables FOO and BAR if we skip comments (but FOO's content will be different) * one variable FOO if we will give \\\n bigger priority There will be corner-cases in which env file will be recognized differently from a shell. IOW this can generate some new suprised systemd-haters. > > But let's take one step back. Can you make a good case why comments > should trump continuation lines? To me that doesn't even sound so > useful, and it would in fact surprise me if things would work that > way... If I can speak for mysel, the Zbigniew's example do what I allways wanted to have in a shell - a way how to easy replace some value, but have the old one in-place as a backup. Regards Michal Vyskocil
signature.asc
Description: Digital signature
_______________________________________________ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel