ubuntu,debian,redhat,fedora,centos
标签类目:group

Finding line number when matching text

分类:Python

  1. src = open('linuxlaptop.htm').read()
  2. pattern = '<P>([^<]+)<SUP>'  # or anything else
  3. for m in re.finditer(pattern, src):
  4.   start = m.start()
  5.   lineno = src.count('\n', 0, start) + 1
  6.   offset = start - src.rfind('\n', 0, start)
  7.   word = m.group(1)
  8.   print "linuxlaptop.htm(%s,%s): %s" % (lineno, offset, word)

/etc/group,/etc/gshadow释疑

你知道/etc/group的第二项是什么意思吗?这项中!和x分别代表什么意思呢?
之前我还真的没有注意到这个问题。于是先man group了一把,给出了的说明是

password the (encrypted) group password. If this field is empty, no password is needed.

继续阅读 »

返回顶部