> > 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
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
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:-.}
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
> 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 *+