Re: Strange behavior (possible bug) using bash command subsitution with "git branch"
- From
Björn Steinbrink <b.steinbrink@gmx.de>
- Date
- Nov 8, 2009, 22:49 UTC
- Message-ID
- <20091108224955.GA14095@atjola.homenet>
- In-Reply-To
- <C71C822C.22429%kate@ning.com>
On 2009.11.08 14:11:56 -0800, Kate Ebneter wrote:
Show 7 quoted lines
> Hi, folks, > > I ran into a weird situation while working on a script, which is best > described with a little snippet from my gitosis-admin repository: > > $ git branch > * master
^^^
> $ branch=$(git branch) > $ echo $branch > gitosis.conf keydir master
Your shell expands the *, thus echo sees all the things in the current directory. Use 'echo "$branch"' and you'll see what you expected.
Björn