shell script

I wrote a bash script to create new pastes on It features automatic source language selection based on the file extension and has a switch to make a private paste.

$ pastie --help
Usage: pastie [options] [files...]

    -h, --help          display this help
    -l, --lang    set language of the paste
    -p, --private       make paste private

If --lang is not specified, this script will try to determine the type of each
file automatically based on the extension. If no files are given on the
command line it reads from standard input.

You can download it here:

The script is public domain, so do whatever you want with it.

Although this is the initial release, I bumped the version number to 1.6 already. During testing the script I pasted itself several times to I set a arbitrary higher version number to avoid confusion in case the previous pastes ever turn up in Google or wherever.

Seems like their parser for shell is a bit broken and doubles the heredoc starting and ending sequences in the output. For whatever reason it appears as “<<END<<END”. Please use the raw version for download instead of copy & paste.

One thought on “ shell script

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.