help-bash
[Top][All Lists]
Advanced

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

Re: default/simple globbing


From: #!microsuxx
Subject: Re: default/simple globbing
Date: Wed, 27 Nov 2024 14:01:17 +0100

.. not spaces safe , but dev sys name usually doesnt have spaces

On Wed, Nov 27, 2024, 1:58 PM #!microsuxx <fxmbsw7@gmail.com> wrote:

> ls
> 2-3  2-3.1  2-3:1.0  usb2
> ~/tt $ a=( *-* ) a=( ${a[@]/*[:.]*} ) ; declare -p a
> declare -a a=([0]="2-3")
>
> 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]