Re: autodetecting MBR location

2001-01-03 Thread dvdeug
Stephen says: > "Russell" == Russell Coker <[EMAIL PROTECTED]> writes: >Russell> Right. The s/[0-9]+$// should do it. > > > > s/\d+$// not s/[0-9]+$//. The former will continue to work in Unicode > capable file-systems (assuming Linux ever supports such). > > It supports them right now - t

Re: autodetecting MBR location

2001-01-02 Thread Stephen Zander
> "Russell" == Russell Coker <[EMAIL PROTECTED]> writes: Russell> Right. The s/[0-9]+$// should do it. s/\d+$// not s/[0-9]+$//. The former will continue to work in Unicode capable file-systems (assuming Linux ever supports such). Nothing to see here, move along... -- Stephen "An

Re: POSIX regular expressions (was: autodetecting MBR location)

2001-01-02 Thread Tollef Fog Heen
* (Colin Watson) | >For a non-POSIX regex, that is. | | Could you point me to some documentation about this? regex(7) claims to | describe POSIX 1003.2 regular expressions, and describes leftmost-first | behaviour. Hmm. Strange. Mastering Regular Expressions by O'Reilly has something about th

POSIX regular expressions (was: autodetecting MBR location)

2001-01-02 Thread Colin Watson
Tollef Fog Heen <[EMAIL PROTECTED]> wrote: >* (Colin Watson) >| Contrary to the subconscious assumption many people make, the first >| priority for a regex is to match earliest, not to match longest. >| regex(7) specifically mentions this: > >For a non-POSIX regex, that is. Could you point me to

Re: autodetecting MBR location

2001-01-02 Thread Russell Coker
On Wednesday 03 January 2001 00:24, Tollef Fog Heen wrote: > | My lilo configuration scripts need to be able to infer the correct > | location for the MBR. I am currently using the following algorithm: > | take root fs device from /etc/fstab and do the following: > | s/[0-9]*// > | s/part$/disc/ >

Re: autodetecting MBR location

2001-01-02 Thread Tollef Fog Heen
* (Colin Watson) | Contrary to the subconscious assumption many people make, the first | priority for a regex is to match earliest, not to match longest. | regex(7) specifically mentions this: For a non-POSIX regex, that is. | >However, stylistically s/[0-9]*// is better written as s/[0-9]+// |

Re: autodetecting MBR location

2001-01-02 Thread Colin Watson
Bart Schuller <[EMAIL PROTECTED]> wrote: >On Tue, Jan 02, 2001 at 02:24:22PM +0100, Tollef Fog Heen wrote: >> | s/[0-9]*// >> | s/part$/disc/ >> >> What is the use of the first s/? Unless your first letter is a digit, >> it will just remove the zero-width string '' between the first / and >> the

Re: autodetecting MBR location

2001-01-02 Thread Tollef Fog Heen
* Goswin Brederlow | > s/[0-9]$// | | > which will remove 5 from /dev/hda5. | | You forgot /dev/hda17, which would become /dev/hda1 with your syntax. you are right. make that regexp a s/[0-9]+$// instead. -- Tollef Fog Heen Unix _IS_ user friendly... It's just selective about who

Re: autodetecting MBR location

2001-01-02 Thread Tollef Fog Heen
* Bart Schuller | On Tue, Jan 02, 2001 at 02:24:22PM +0100, Tollef Fog Heen wrote: | > | s/[0-9]*// | > | s/part$/disc/ | > | > What is the use of the first s/? Unless your first letter is a digit, | > it will just remove the zero-width string '' between the first / and | > the beginning of the

Re: autodetecting MBR location

2001-01-02 Thread Goswin Brederlow
> " " == Tollef Fog Heen <[EMAIL PROTECTED]> writes: > * Russell Coker | My lilo configuration scripts need to be able > to infer the correct location | for the MBR. I am currently > using the following algorithm: | take root fs device from > /etc/fstab and do the followin

Re: autodetecting MBR location

2001-01-02 Thread Bart Schuller
On Tue, Jan 02, 2001 at 02:24:22PM +0100, Tollef Fog Heen wrote: > | s/[0-9]*// > | s/part$/disc/ > > What is the use of the first s/? Unless your first letter is a digit, > it will just remove the zero-width string '' between the first / and > the beginning of the string. > > A better solution

Re: autodetecting MBR location

2001-01-02 Thread Tollef Fog Heen
* Russell Coker | My lilo configuration scripts need to be able to infer the correct location | for the MBR. I am currently using the following algorithm: | take root fs device from /etc/fstab and do the following: | s/[0-9]*// | s/part$/disc/ What is the use of the first s/? Unless your firs

autodetecting MBR location

2001-01-02 Thread Russell Coker
My lilo configuration scripts need to be able to infer the correct location for the MBR. I am currently using the following algorithm: take root fs device from /etc/fstab and do the following: s/[0-9]*// s/part$/disc/ The latter is for devfs. Now for the benefit of RAID systems I need to do: if