Managing system configuration with hg?
Andreas Niederl
rico32 at gmx.net
Wed Jan 31 22:50:02 UTC 2007
Ed Santiago wrote:
> >> status=$(hg status)
> >> [...]
> >> hg status | sed -e 's/^/ /'
> >
> >What about running hg status just once and replacing the second call
> >with a simple echo command?
> >
> >echo "$status" | sed -e 's/^/ /'
>
> The newlines will be lost:
>
> $ printf "a b c\ndef\n"
> a b c
> def
> $ foo=$(!!);echo $foo
> a b c def
>
> It's possible to work around this in several ways, eg $IFS or
> by doing the indentation in the status=$(...) itself. Each
> has its tradeoffs, and this was just a quick hack anyway.
> I've spent more time writing this email than on the script
> itself. I wasn't striving for perfection :-)
I remember vaguely about it. I must have forgotten most of these little
annoyances in /bin/(sh|bash) since I do my scripting with zsh.
As for your system configuration management, do you use it on a per-host
basis or do you share parts of your configuration among different hosts?
In the latter case, what's your strategy on separating local from global
configuration files?
Regards,
Andi
More information about the Mercurial
mailing list