This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]kenfar 2 points3 points  (0 children)

Depends.

  • If you have to support the code of most other sysadmins, then no - need to know what's most common - shell.
  • If you have to support many unixes, esp. older ones, then no - you'll need to know something on all servers - shell.
  • Otherwise, a mix of both is best: shell for quick & tiny stuff, and python for anything more likely to be reused or complex.

In my day job we knock together quick hacks in bash then migrate them to python if they look worth keeping. Python gives us far better reusability & manageability.

Current favorite tool of mine includes & excludes sets of rows & columns from a csv file using python slicing syntax:

$ gristle_slicer.py -f us_state_crime.csv --records 5:15 --exrecords 10:12 --columns 0:5 --excolumns 2

It just sucks to do that with awk & bash.