From: Andrew Sayers <andrew-git@pileofstuff.org>
To: solsTiCe d'Hiver <solstice.dhiver@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [bash-completion] syntax error near unexpected token '<' on line 123 in bash_completion.d/git
Date: Sun, 25 Jul 2010 21:01:48 +0100 [thread overview]
Message-ID: <4C4C982C.20904@pileofstuff.org> (raw)
In-Reply-To: <1280056320.7883.9.camel@soho.example.org>
"< <()" is indeed correct here: the first "<" is a normal shell
redirect, and the "<()" creates a sub-shell to read input from. This
was the least messy way I could find to read variables into a shell. "<
$()" won't do the job, and a normal pipe won't either:
$ FOO=parent ; echo child | { read ; FOO="$REPLY" ; } ; echo $FOO
parent
$ FOO=parent ; { read ; FOO="$REPLY" ; } < $( echo child ) ; echo $FOO
bash: child: No such file or directory
parent
$ FOO=parent ; { read ; FOO="$REPLY" ; } < <( echo child ) ; echo $FOO
child
Is "syntax error near unexpected token '<' on line 123" the complete
text of the error message you get? bash 4.1.5 always prepends "bash: "
to such errors for me:
$ while false ; do echo foo ; done < ;
bash: syntax error near unexpected token `;'
If this is the complete error text, then I suspect you may have somehow
got bash completion in a non-bash shell. Could you add this on line 98
and let me know what it says:
echo $BASH_VERSION $BASHOPTS
If it really is bash, $BASHOPTS might help me to replicate this problem
(or I might have to read the man page some more).
- Andrew
next prev parent reply other threads:[~2010-07-25 20:50 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-25 11:12 [bash-completion] syntax error near unexpected token '<' on line 123 in bash_completion.d/git solsTiCe d'Hiver
2010-07-25 11:49 ` Ævar Arnfjörð Bjarmason
2010-07-25 20:01 ` Andrew Sayers [this message]
2010-07-25 22:19 ` solsTiCe d'Hiver
2010-07-26 21:39 ` Andrew Sayers
2010-07-27 9:24 ` solsTiCe d'Hiver
2010-07-27 10:43 ` solsTiCe d'Hiver
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=4C4C982C.20904@pileofstuff.org \
--to=andrew-git@pileofstuff.org \
--cc=git@vger.kernel.org \
--cc=solstice.dhiver@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.