Re: A little regex help please ...

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

 



El Lunes, 10 de Julio de 2006 11:07, T. Horsnell escribió:
> This is not very elegant, but:
>
> alf1_tsh> echo "5.1.2" | cut -d "-" -f 1 | cut -d "_" -f 1
> 5.1.2
> alf1_tsh> echo "5.1.2_ABC" | cut -d "-" -f 1 | cut -d "_" -f 1
> 5.1.2
> alf1_tsh> echo "5.1.2-ABC" | cut -d "-" -f 1 | cut -d "_" -f 1
> 5.1.2
>
> so:
>
> VAR=`echo $f | cut -d "-" -f 1 | cut -d "_" -f 1`
>
> should do it.

Oh!
I see.

In that case, I suggest:
for i in ?.?.?

I tried to do the "logical-to-me" expansion:

  for i in *.[:digit:]

But that didn't work for me on bash 3.1.7(1) 
Anybody knows what did I do wrong?
Maybe something to set with shopt?

-- 
Mauricio Vergara Ereche                   User #188365 counter.li.org

-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux