What is the difference between
function searchGitAliases() {
found=$(cat ~/aliases/.gitAliases| sed -e 's/alias //g' -e 's/function //g' -e 's/=.*//g' -e 's/()//g' -e 's/{.*//g' | sort -r -u | fzf) && eval ${found}
}
and
function searchGitAliases(){ found=$(cat ~/aliases/.gitAliases | sed -e 's/alias //g' -e 's/function //g' -e 's/=.*//g' -e 's/()//g' -e 's/{.*//g' | sort -r -u | fzf) && eval ${found} }
The first one works without problems, the second one does not.
When I run it in the shell it expects another closing bracket
function searchGitAliases(){ found=$(cat ~/aliases/.gitAliases | sed -e 's/alias //g' -e 's/function //g' -e 's/=.*//g' -e 's/()//g' -e 's/{.*//g' | sort -r -u | fzf) && eval ${found} }
> }
I cant see any difference between them except that the first one is on a different line while the second one has the body on the same line. Does this matter in bash?
Note: Both work in zsh.