Skip to content

jekor/hesh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hesh - The Haskell-Extensible Shell

Hesh makes writing scripts in Haskell easier. Here's an example:

#!/usr/bin/env hesh
-- Backup a PostgreSQL database to an encrypted file.

main = do
  args <- System.Environment.getArgs
  case args of
    [database] -> do
      today <- $(date +%Y-%m-%d)
      let file = database ++ "-" ++ today ++ ".sql.gpg"
      $(pg_dump $database) |> $(gpg -e -r $EMAIL) /> file
    _ -> do
      progName <- System.Environment.getProgName
      $(echo "Usage: $progName <database>") /> "/dev/stderr"

For more details, see the manual.