Git development
 help / color / mirror / Atom feed
From: "Björn Steinbrink" <B.Steinbrink@gmx.de>
To: Kate Ebneter <kate@ning.com>
Cc: git@vger.kernel.org
Subject: Re: Strange behavior (possible bug) using bash command subsitution with "git branch"
Date: Sun, 8 Nov 2009 23:49:55 +0100	[thread overview]
Message-ID: <20091108224955.GA14095@atjola.homenet> (raw)
In-Reply-To: <C71C822C.22429%kate@ning.com>

On 2009.11.08 14:11:56 -0800, Kate Ebneter wrote:
> 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

  parent reply	other threads:[~2009-11-08 22:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-08 22:11 Strange behavior (possible bug) using bash command subsitution with "git branch" Kate Ebneter
2009-11-08 22:46 ` Sverre Rabbelier
2009-11-08 22:50   ` Kate Ebneter
2009-11-08 22:49 ` Björn Steinbrink [this message]
2009-11-08 23:03   ` Jeff King
2009-11-08 23:10     ` Kate Ebneter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20091108224955.GA14095@atjola.homenet \
    --to=b.steinbrink@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=kate@ning.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox