Skip to content

Instantly share code, notes, and snippets.

@hideshi
Created February 1, 2014 16:13
Show Gist options
  • Save hideshi/8754361 to your computer and use it in GitHub Desktop.
Save hideshi/8754361 to your computer and use it in GitHub Desktop.
How to use Python in shell script
#!/bin/sh
ls -l | python3.3 -c '
import sys
import re
for i in sys.stdin:
line = re.compile(r"\s+").split(i.strip())
if len(line) == 9:
print(line[8])
'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment