Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

🐚 Out of the shell solution for scripting in Haskell

License

NotificationsYou must be signed in to change notification settings

kowainik/shellmet

Repository files navigation

GitHub CIHackageStackage LtsStackage NightlyMPL-2.0 license

Out of the shell solution for scripting in Haskell. Shellmet provides an easy andconvenient way to call shell commands from Haskell programs.

Usage example

This README contains the usage example of theshellmet library. The example isrunnable. You can build and execute with the following command:

cabal run readme

Setting up

Since this tutorial is written using Literate Haskell, first, let's write allnecessary pragmas and imports.

{-#LANGUAGE OverloadedStrings #-}importData.Semigroup ((<>))importShellmet (($|))importqualifiedData.TextasT

Simple scripting example

Below you can see how easy it is to interact with shell commands in Haskell:

main::IO()main=do"echo" ["Starting shellmet readme..."]    text<-"cat"$| ["README.md"]let cnt=T.pack$show$length$T.lines text"echo" ["Number of lines in this README:"<> cnt]

And the output is:

⚙  echo 'Starting shellmet readme...'Starting shellmet readme...⚙  echo 'Number of lines in this README: 54'Number of lines in this README: 54

[8]ページ先頭

©2009-2025 Movatter.jp