From f2ed10433e2dcf4a57f04b4e10e0ec8e0d30d119 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Tue, 30 Jul 2013 14:58:54 +1200 Subject: More portable non-surprise syntax for functions is this syntax actually problematic? function whatever { thangs } !pf function http://mywiki.wooledge.org/BashPitfalls#pf25 -- Don't do this! -- function foo() i know it's bashism, but is it bad practice yeah i know that much (no parens, that is) it's not necessarily a bashism, but the function keyword has implications in other shells and, perhaps someday in the future, for bash as well hmm, so i should use this syntax even if the scripts are explicitly bash? hi zendeavor :) you should use foo() { echo bar; } rightoh no surprising behaviour that way, ever makes sense it won't matter *much* but element of least surprise --- bash/bashrc.d/grep.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bash/bashrc.d/grep.bash') diff --git a/bash/bashrc.d/grep.bash b/bash/bashrc.d/grep.bash index e5a568e1..ea75bd8e 100644 --- a/bash/bashrc.d/grep.bash +++ b/bash/bashrc.d/grep.bash @@ -1,5 +1,5 @@ # Function returns calculated options for grep -function __grepopts { +__grepopts() { local grepopts='-I' local grephelp=$(grep --help) echo $grephelp | grep -- --color &>/dev/null \ -- cgit v1.2.3