[pass] Removing Bash Dependency
Stephen Paul Weber
singpolyma at singpolyma.net
Tue Sep 11 21:13:51 CEST 2012
Somebody claiming to be Jason A. Donenfeld wrote:
>On Tue, Sep 11, 2012 at 9:00 PM, Stephen Paul Weber
><singpolyma at singpolyma.net> wrote:
>> FYI, if you ever decide you're ok with nixing the bash dependency
>Disown is nicer than making two sub-shells like in your
>previous patch (does that even work?).
Yes. It's equivalent to the way that every daemon program not written in
shell works (double-fork).
>And I kind of like [[ ]], but I guess I could learn to live without it.
I've observed in the many bash script I've ported in the past that in
general people use [[ ]] not for any features it actually has, but because
it's what they learned. pass uses =~ which is maybe a little nicer syntax
than using grep (if only because you don't need > /dev/null), but not by
much. It also uses short-circuits (which can either be replaced by actual
shell short-circuits, or by non-short-circuits, depending on the context and
preference), which are actually suprisingly rare.
Beyond that it's just equality comparators. It's amazing to me how many
other scripts I've ported where all I had to do was replace
[[ "$a" == "b" ]] with [ "$a" = "b" ] and it no longer needed bash. This is
in fact the largest part of even the porting that goes into pass.
Anyway, that's just me being verbose. It's your project, and obviously the
choice is up to you. I only made the suggestion on the basis of your
"standard UNIX construction"-ish tagline, which I like. If it were in
Python I wouldn't go about rewriting it in Ruby, heh.
--
Stephen Paul Weber, @singpolyma
See <http://singpolyma.net> for how I prefer to be contacted
edition right joseph
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.zx2c4.com/pipermail/password-store/attachments/20120911/0c3f4a0c/attachment.asc>
More information about the Password-Store
mailing list