GCD now joins multiple args

This commit is contained in:
q
2014-07-18 20:42:14 +03:00
parent deff2d7573
commit 197271fd01

View File

@@ -172,9 +172,12 @@ function gcd() {
local dname
local bname
local match
local join
set -o pipefail
dname=$( dirname "$1" )
bname=$( basename "$1" )
join="$@"
join=${join// /.}
dname=$( dirname "$join" )
bname=$( basename "$join" )
match=$( ls -d "$dname"/*/ | grep "$bname" | head -n 1 )
[[ ! "$match" = "" ]] && {
echo $match | grep --color=always "$bname"