module Main(main) where import Shell(launch) import System.Environment(getEnv) import System.IO(IO,hGetContents) main :: IO () main = do homedir <- getEnv "HOME" (_,output,_) <- launch "ls" ["ls", "-a", homedir] ls_output <- hGetContents output let dotFiles = (filter beginsWithDot) . lines $ ls_output putStr . unlines $ dotFiles where beginsWithDot :: String -> Bool beginsWithDot "." = False -- Exclude Special . and .. files. beginsWithDot ".." = False beginsWithDot ('.':_) = True beginsWithDot _ = False