aboutsummaryrefslogtreecommitdiff
path: root/rc.multi
diff options
context:
space:
mode:
authorVictor Lowther <victor.lowther@gmail.com>2010-07-03 11:26:31 -0500
committerVictor Lowther <victor.lowther@gmail.com>2010-07-11 20:23:42 -0500
commit350cbc9ab1b2f320bfd8b7a09bda49c8f3e7f83c (patch)
treebb67811441614fe61a77ed72bbe51986a3c87122 /rc.multi
parent9c920cd09d1b0a9a53a4ac62981ed41431a610df (diff)
downloadinitscripts-350cbc9ab1b2f320bfd8b7a09bda49c8f3e7f83c.tar.xz
Finish bashifying functions.
Slightly simplify hook-running infrastructure. Go ahead and declare add_hook and run_hook as readonly functions to prevent hooks from overwriting them. Too bad bash does not have lexically scoped variables -- if it does, we could do the same with the hook_funcs associative array. If $CONSOLEFONT is not declared, then just return out of set_consolefont. We do this early so that the entire body of the function is not in an if block. Replace trivial use of grep with bash regex conditional. Bash has regex support, and it allows us to replace most trivial uses of sed, grep, and awk. The fewer processes we create, the faster we go, and every little bit helps. I also think it is more readable to use a bash regex for the trivial stuff. Replace if statement with parameter expansion. ${foo:+-p ${foo}} expands to nothing if foo is not set, -p $foo if foo is set. Replace slightly too long echo staement with a here document. This adds a line, but making things more readable is worth it. Make sourcing functions.d files a tiny bit shorter and faster.
Diffstat (limited to 'rc.multi')
0 files changed, 0 insertions, 0 deletions