chaosfoal
chaosfoal

Reputation: 43

globstar set in terminal not propagating to script

I need to build a library with the build.sh provided with the source. It contains a globstar path (src/**/*.java). I enabled globstar with shopt -s globstar and all works great from terminal but from bash file:

#!/bin/bash
ls **/*.java

I get the following error:

ls: cannot access **/*.java: No such file or directory

Upvotes: 4

Views: 1295

Answers (1)

choroba
choroba

Reputation: 241898

Just put

shopt -s globstar

into the script as well.

Upvotes: 8

Related Questions