On 16.05.2014 06:22, Zbigniew Jędrzejewski-Szmek wrote: > On Fri, May 16, 2014 at 12:30:45AM +0200, Lennart Poettering wrote: >> >> I'd really prefer if somebody who's a true shell guru could look over >> this. Harald? (Or Zbigniew?) > If I review it, do I get to become a true shell guru? ;)
So.. here is my shell implementation (tested for some years): http://git.kernel.org/cgit/boot/dracut/dracut.git/tree/dracut-functions.sh#n300 With convert_abs_rel() http://git.kernel.org/cgit/boot/dracut/dracut.git/tree/dracut-functions.sh#n246 and normalize_path() http://git.kernel.org/cgit/boot/dracut/dracut.git/tree/dracut-functions.sh#n239 normally I stop reviewing shell code for bash, when I see something like: `` and "head -1" and "cut -d ' ' -f 4" * `` should be $() * "head -1" can be "{ read line; do_something_with $line;}" * "cut -d ' ' -f 4" can be "{ read a a a val a; do_something with $val; }" or even use "read -a ..." * ... the list goes on _______________________________________________ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel