help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-bash] Expand file contents, bash-style


From: Federico Prades Illanes
Subject: Re: [Help-bash] Expand file contents, bash-style
Date: Wed, 27 Aug 2014 09:44:07 +0200

Thanks Greg, really obvious - a different working directory - shame on me.


On 26 August 2014 19:49, Greg Wooledge <address@hidden> wrote:

> 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).
>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]