[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-bash] Expand file contents, bash-style
From: |
Greg Wooledge |
Subject: |
Re: [Help-bash] Expand file contents, bash-style |
Date: |
Tue, 26 Aug 2014 13:49:01 -0400 |
User-agent: |
Mutt/1.4.2.3i |
On Tue, Aug 26, 2014 at 06:07:07PM +0200, Federico Prades Illanes wrote:
> $ ls
> > files.txt foo fool script.sh
> > $ cat files.txt
> > foo*
> > $ cat script.sh
> > #!/bin/bash -x
> > echo $(< files.txt)
This is relying on an unquoted substitution being globbed. Yuck.
> > $ ./script.sh
> > + echo foo fool
> > foo fool
> However under Jenkins
>
> + echo 'foo*'
> > foo*
The most obvious reasons this could "fail" are:
1) Under Jenkins, whatever that is, the script is running in a different
working directory. There aren't any files matching the glob foo* for
it to expand to.
2) Under Jenkins, the shell is being invoked in such a way that globbing
is disabled (set -f, set -o noglob, or something equivalent).