help-bash
[Top][All Lists]
Advanced

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

Re: default/simple globbing


From: ikhxcsz7y xmbott
Subject: Re: default/simple globbing
Date: Thu, 28 Nov 2024 22:02:27 +0100

match='/sys/bus/usb/devices/[0-9]*[!:.]?' ; for d in $match ; do [[ $d !=
"$match" ]] && echo $d ; done

On Wed, Nov 27, 2024, 12:56 PM lacsaP Patatetom <patatetom@gmail.com> wrote:

> hi,
>
> I try to display only part of the `/sys/bus/usb/devices/` folder with `ls
> /sys/bus/usb/devices/*-*[!.:]*` or `ls /sys/bus/usb/devices/*-*[^.:]*` but
> it doesn't subtract entries with a dot or colon in their name (only usb
> entries are removed).
>
> if it's possible, what is the correct expression to use without having to
> activate extended globbing ?
>
> regards, lacsaP.
>
> $ ls /sys/bus/usb/devices/
> ...
> /sys/bus/usb/devices/2-3
> /sys/bus/usb/devices/2-3.1
> /sys/bus/usb/devices/2-3:1.0
> /sys/bus/usb/devices/usb2
> ...
>
> $ ls /sys/bus/usb/devices/*-*[!.:]*
> ...
> /sys/bus/usb/devices/2-3
> /sys/bus/usb/devices/2-3.1
> /sys/bus/usb/devices/2-3:1.0
> ...
>


reply via email to

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