From 2f4ad187043897812b0f2bfdcfb5596034ba8ff9 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Thu, 18 Jun 2020 14:57:21 -0700 Subject: bash: add ff and regex aliases --- lib/common.nix | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/common.nix') diff --git a/lib/common.nix b/lib/common.nix index 5c923ae..e9c270e 100644 --- a/lib/common.nix +++ b/lib/common.nix @@ -148,6 +148,12 @@ in done cd "$P" } + function ff() { + find . -iname "*$@*" -not -path "*.git*" + } + function regex { + gawk 'match($0,/'$1'/, ary) {print ary['\$\{2:-'0'}']}'; + } # my prompt, after much chagrin export PS1="\n\[\e[34m\][\u@\h:\w]\[\e[m\] \$(date +%Y.%m.%d..%H.%M) \$(if [ \$? == 0 ]; then true; else echo \(\$?\); fi) \n$ " ''; -- cgit v1.2.3