Skip to content

Commit e3c82e1

Browse files
committed
Demonstration of lambda function in use with a common system administration task
1 parent f548289 commit e3c82e1

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#! /usr/bin/env python
2+
#
3+
# Demonstration of using lambda functions for common UNIX system
4+
# administration tasks
5+
import subprocess
6+
7+
lines = subprocess.check_output(['mount', '-v'])
8+
lines = lines.splitlines()
9+
mount_points = map(lambda line: line.split()[2], lines)
10+
print mount_points

0 commit comments

Comments
 (0)