bug-bash@gnu.org

2013-10-30 Thread Peggy Russell
> > You missed one set of quotes: > > > > for f in "${1:-.}"/*; do > > That still won't handle whitespace in file names. Probably better to > use find instead. > > Andreas. find is cool. ls has an -I, --ignore=PATTERN ls -l -I"*-IGN-*" Greg added the quotes. Thanks. I tested with: mkdi

bug-bash@gnu.org

2013-10-30 Thread Greg Wooledge
On Wed, Oct 30, 2013 at 12:58:54PM +0100, Andreas Schwab wrote: > Greg Wooledge writes: > > > On Wed, Oct 30, 2013 at 08:01:02AM +, Peggy Russell wrote: > >> A variation: > >> > >> shopt -s nullglob > >> for f in ${1:-.}/*; do > >> if [[ "${f}" != *-IGN-* ]]; > >> then printf -- '%s\n

bug-bash@gnu.org

2013-10-30 Thread Andreas Schwab
Greg Wooledge writes: > On Wed, Oct 30, 2013 at 08:01:02AM +, Peggy Russell wrote: >> A variation: >> >> shopt -s nullglob >> for f in ${1:-.}/*; do >> if [[ "${f}" != *-IGN-* ]]; >> then printf -- '%s\n' "${f}" >> fi >> done > > You missed one set of quotes: > > for f in "${1:-.}

bug-bash@gnu.org

2013-10-30 Thread Greg Wooledge
On Wed, Oct 30, 2013 at 08:01:02AM +, Peggy Russell wrote: > A variation: > > shopt -s nullglob > for f in ${1:-.}/*; do > if [[ "${f}" != *-IGN-* ]]; > then printf -- '%s\n' "${f}" > fi > done You missed one set of quotes: for f in "${1:-.}"/*; do

bug-bash@gnu.org

2013-10-30 Thread Peggy Russell
> I am missing how to create a bash-pattern that excludes a specific pattern. > > I.e. to ignore any file with '-IGN-' somewhere in the filename. > > The best I've come up with so far has been to use shell to build > a pattern, but I know it is limited in functionality. I.e.: > > ls !($(echo *+