Skip to content

Instantly share code, notes, and snippets.

@mbadolato
Created April 23, 2015 19:45
Show Gist options
  • Save mbadolato/5f5a8c204826a77f99d0 to your computer and use it in GitHub Desktop.
Save mbadolato/5f5a8c204826a77f99d0 to your computer and use it in GitHub Desktop.

Revisions

  1. mbadolato created this gist Apr 23, 2015.
    12 changes: 12 additions & 0 deletions bash_history_to_zsh.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    // This is how I used it:
    // $ node bash-history-to-zsh-history.js >> ~/.zsh_history

    var fs = require("fs");
    var a = fs.readFileSync("bash_history");
    var time = Date.now();

    a.toString().split("\n").forEach(
    function(line) {
    console.log(": "+ (time++) + ":0;" + line);
    }
    );