Skip to content

Instantly share code, notes, and snippets.

@t94j0
Created February 13, 2019 23:37
Show Gist options
  • Save t94j0/7ae0b1d5699ec20b363704a498da32b7 to your computer and use it in GitHub Desktop.
Save t94j0/7ae0b1d5699ec20b363704a498da32b7 to your computer and use it in GitHub Desktop.
import System.IO
import Data.Dates
import Data.List.Split
data ShadowEntry = ShadowEntry {
username :: String,
hash :: String
} deriving (Show)
parseShadowEntryString :: String -> ShadowEntry
parseShadowEntryString x = ShadowEntry (splitOn ":" x !! 0) (splitOn ":" x !! 1)
main = do
shadow <- readFile "./shadow"
putStr $ parseShadowEntryString "root:ABC"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment