Comment

Anonymous

My fault, I should have used an example.

basename "$repo_name"

it is the quoting that is important, it makes basename treat the string as an ugly space and symbol including filename

Parent comment

Peter Bengtsson

I think I know what you mean but the whole string starts with "== Remote URL: " which means that basename fails on it. $ repo_name=`git info | head -n1` $ basename $repo_name basename: extra operand `URL:' Try `basename --help' for more information.