Skip to content

Instantly share code, notes, and snippets.

@bheru27
Created December 14, 2015 22:28
Show Gist options
  • Save bheru27/762f0d58af08f5108cb6 to your computer and use it in GitHub Desktop.
Save bheru27/762f0d58af08f5108cb6 to your computer and use it in GitHub Desktop.
.bash_history to .zsh_history converter
#!/usr/bin/env python2
#usage: cat .bash_history | ./bash2zsh.py >> .zsh_history
import sys
import time
for line in sys.stdin:
line = line.rstrip('\n')
timestamp = int(time.time())
sys.stdout.write(': %s:0;%s\n' %(timestamp, line))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment