Re: [Ubuntu-zh] 怎么取得一行文本中的邮件地址?

2010-06-19 文章 listofx
On 五, 2010-06-18 at 22:33 +0800, Tusooa Zhu wrote:
> 在 星期五 18 6月 2010 02:06:57,listofx 写
> 道:
> > 通常,邮件头中发件人有如下格式
> > From: xxx yyy 
> > From: “xxx yyy” 
> > From: x...@ubuntu.com
> > 
> > 我想提取这样一行中的地址(只是
> x...@ubuntu.com),该如何进行?
> > 
> > 我知道:如果不考虑第三种情况,采用<字
> 符作为字段分隔符,使用cut或者awk就
> > 很容易得到结果。
> > 
> > sed能做到吗?
> > 在发邮件的时候,我想到一个办法,还是想
> 看看是否有别的方式。
> 
> sed -e 's/.*<\(.*\)>.*/\1/'

我在man sed中看到\1的解释,但是没有看懂。即使看到您的回复,动手操作了一
下,还是不明白\1的作用。
……
我终于在手里的一本电子书中找到了相应信息。也许info sed中有解释(info sed
的信息比man sed详细),但是个人真的不喜欢info,凡是按键和vi不一致的都不
习惯。
谢谢!

解释如下,放在这里说不定有用。
The sed editor uses parentheses to define a substring component within the 
substitution pattern.
You can then reference each substring component using a special character in 
the replacement
pattern. The replacement character consists of a backslash and a number. The 
number indicates
the position of the substring component. The sed editor assigns the first 
component the character
\1, the second component the character \2, and so on.



-- 
ubuntu-zh mailing list
ubuntu-zh@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-zh


Re: [Ubuntu-zh] 怎么取得一行文本中的邮件地址?

2010-06-19 文章 Ray Wang
\1 是显示在第一个括号中的内容,在这里括号中匹配的是中的...@xxx.xxx
所以\1 就是显示...@xxx.xxx

2010/6/19 listofx :
> On 五, 2010-06-18 at 22:33 +0800, Tusooa Zhu wrote:
>> 在 星期五 18 6月 2010 02:06:57,listofx 写
>> 道:
>> > 通常,邮件头中发件人有如下格式
>> > From: xxx yyy 
>> > From: “xxx yyy” 
>> > From: x...@ubuntu.com
>> >
>> > 我想提取这样一行中的地址(只是
>> x...@ubuntu.com),该如何进行?
>> >
>> > 我知道:如果不考虑第三种情况,采用<字
>> 符作为字段分隔符,使用cut或者awk就
>> > 很容易得到结果。
>> >
>> > sed能做到吗?
>> > 在发邮件的时候,我想到一个办法,还是想
>> 看看是否有别的方式。
>>
>> sed -e 's/.*<\(.*\)>.*/\1/'
>
> 我在man sed中看到\1的解释,但是没有看懂。即使看到您的回复,动手操作了一
> 下,还是不明白\1的作用。
> ……
> 我终于在手里的一本电子书中找到了相应信息。也许info sed中有解释(info sed
> 的信息比man sed详细),但是个人真的不喜欢info,凡是按键和vi不一致的都不
> 习惯。
> 谢谢!
>
> 解释如下,放在这里说不定有用。
> The sed editor uses parentheses to define a substring component within the 
> substitution pattern.
> You can then reference each substring component using a special character in 
> the replacement
> pattern. The replacement character consists of a backslash and a number. The 
> number indicates
> the position of the substring component. The sed editor assigns the first 
> component the character
> \1, the second component the character \2, and so on.
>
>
>
> --
> ubuntu-zh mailing list
> ubuntu-zh@lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/ubuntu-zh
>



-- 
Ray Wang
  - Follow your dreams
-- 
ubuntu-zh mailing list
ubuntu-zh@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-zh


[Ubuntu-zh] ubuntu 10.04启动时扫描磁盘慢

2010-06-19 文章 listofx
我的/home分区大约有70G,开始磁盘扫描的时候非常慢。我后来手动执行了一次,
fsck.ext4 -C 0 -f -v /dev/sda3
发现在第一个阶段,checking inodes, blocks, and sizes很慢。

大家开机磁盘检查慢不慢?

我都考虑将/home重新倒腾一下(备份,重建该分区),就是不知道是否有用。

权且之计,我将该分区的磁盘扫描关掉了(fstab文件中/home一行最后一列的2改
为0)


-- 
ubuntu-zh mailing list
ubuntu-zh@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-zh


Re: [Ubuntu-zh] ubuntu 10.04启动时扫描磁盘慢

2010-06-19 文章 Ray Wang
我的/home 100G, 好像没有你说的现象,
倒是从Grub 进入linux ,在解压kernel 时需要等10秒左右

2010/6/20 listofx :
> 我的/home分区大约有70G,开始磁盘扫描的时候非常慢。我后来手动执行了一次,
> fsck.ext4 -C 0 -f -v /dev/sda3
> 发现在第一个阶段,checking inodes, blocks, and sizes很慢。
>
> 大家开机磁盘检查慢不慢?
>
> 我都考虑将/home重新倒腾一下(备份,重建该分区),就是不知道是否有用。
>
> 权且之计,我将该分区的磁盘扫描关掉了(fstab文件中/home一行最后一列的2改
> 为0)
>
>
> --
> ubuntu-zh mailing list
> ubuntu-zh@lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/ubuntu-zh
>



-- 
Ray Wang
  - Follow your dreams
-- 
ubuntu-zh mailing list
ubuntu-zh@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-zh