Gentoo Archives: gentoo-dev

From: "Harald van Dijk" <truedfx@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] baselayout-1.13 going into ~ARCH soon
Date: Wed, 08 Nov 2006 07:01:41
Message-Id: 20061108065740.GA3657@gentoo.org
In Reply to: Re: [gentoo-dev] baselayout-1.13 going into ~ARCH soon by Roy Marples
1 On Tue, Nov 07, 2006 at 08:47:18PM +0000, Roy Marples wrote:
2 > On Tuesday 07 November 2006 20:32, Drake Wyrm wrote:
3 > > I could be missing something, but:
4 > >
5 > > [[ $'\nwombat' =~ $'wombat' ]] && \
6 > > echo "These compare as equal, with or without the leading \n"
7 >
8 > A working example in bash-3.2 :)
9 >
10 > [[ $(</proc/mounts) =~ $'\n'/dev/root\ ]] \
11 > && echo "Yay, I matched ^/dev/root "
12 >
13 > I challenge you to get an exact match of /dev/root being on the first line
14
15 You mean being first on a line, right?
16
17 > using the == operator and/or quoting.
18 > Remember, /dev/root/foo and /dev/foo /dev/root must not match either.
19 >
20 > If you can you get credit in the ChangeLog :)
21
22 [[ "
23 $(</proc/mounts)" == *"
24 /dev/root "* ]] && echo "Yay, I matched ^/dev/root"
25
26 You can use $'\n' instead of actual newline characters, of course.
27 --
28 gentoo-dev@g.o mailing list

Replies

Subject Author
Re: [gentoo-dev] baselayout-1.13 going into ~ARCH soon Roy Marples <uberlord@g.o>