# \#script

**URL:** https://forum.elixirforum.com/tag/script/309.md

[Latest](https://forum.elixirforum.com/latest.md) · [Categories](https://forum.elixirforum.com/categories.md) · [Tags](https://forum.elixirforum.com/tags.md)

---

## [Running a shell command when exiting an Elixir script](https://forum.elixirforum.com/t/running-a-shell-command-when-exiting-an-elixir-script/71785)

<div class="topic-metadata">

**Author:** [@sezaru](https://forum.elixirforum.com/u/sezaru)\
**Replies:** 8\
**Last updated:** [July 23, 2025, 6:56pm UTC](https://forum.elixirforum.com/t/running-a-shell-command-when-exiting-an-elixir-script/71785 "2025-07-23T18:56:25Z")

</div>

I have a mix task that does some stuff, and in the end it created a shell command that I want to run. The command can be something that willl require full IO support, so you can something like a psql session, an ssh sess…

---

## [Should Elixir replace Ruby for simple scripting?](https://forum.elixirforum.com/t/should-elixir-replace-ruby-for-simple-scripting/58214)

<div class="topic-metadata">

**Author:** [@rahil627](https://forum.elixirforum.com/u/rahil627)\
**Replies:** 22\
**Last updated:** [August 18, 2024, 1:17pm UTC](https://forum.elixirforum.com/t/should-elixir-replace-ruby-for-simple-scripting/58214 "2024-08-18T13:17:10Z")

</div>

I’ve been out of the computer world for ages. During those ages, I’ve got a bunch of ideas. I’ve chosen Phoenix/Elixir (over Flutter/Dart/Google) to prototype most of 'em quickly. Although the core apps will be written …

---

## [Elixir exs script - keyboard capture](https://forum.elixirforum.com/t/elixir-exs-script-keyboard-capture/62277)

<div class="topic-metadata">

**Author:** [@dbsimmons64](https://forum.elixirforum.com/u/dbsimmons64)\
**Replies:** 2\
**Last updated:** [March 13, 2024, 7:36pm UTC](https://forum.elixirforum.com/t/elixir-exs-script-keyboard-capture/62277 "2024-03-13T19:36:47Z")

</div>

Hi All. Is it possible to capture keyboard input on a key by key basis? I’d like to write a script that enables the user to press the arrow keys. I’ve looked at Owl and Ratatouille but the first doesn’t support it and t…

---

## [ExPression - evaluate user input expressions](https://forum.elixirforum.com/t/expression-evaluate-user-input-expressions/61126)

<div class="topic-metadata">

**Author:** [@mtvch](https://forum.elixirforum.com/u/mtvch)\
**Replies:** 4\
**Last updated:** [January 23, 2024, 8:42pm UTC](https://forum.elixirforum.com/t/expression-evaluate-user-input-expressions/61126 "2024-01-23T20:42:18Z")

</div>

I was looking for a library for safely evaluating expressions written by users but didn’t find one that would match my needs. I wanted it to be extensible, support all JSON data types, and have its syntax and semantics i…

---

## [Need help with app architecture - how to dynamically run code?](https://forum.elixirforum.com/t/need-help-with-app-architecture-how-to-dynamically-run-code/58050)

<div class="topic-metadata">

**Author:** [@yolo007wizard](https://forum.elixirforum.com/u/yolo007wizard)\
**Replies:** 17\
**Last updated:** [September 9, 2023, 5:53pm UTC](https://forum.elixirforum.com/t/need-help-with-app-architecture-how-to-dynamically-run-code/58050 "2023-09-09T17:53:12Z")

</div>

Problem Statement: I am trying to build an ‘action runner’ for judge json rules. In a nut shell, say a json defined rule matches with action string: { ...rule "action": "collect\_signature" } I’m trying to think of …

---

## [Using dagger Elixir SDK to refactor a script](https://forum.elixirforum.com/t/using-dagger-elixir-sdk-to-refactor-a-script/56748)

<div class="topic-metadata">

**Author:** [@gmile](https://forum.elixirforum.com/u/gmile)\
**Replies:** 0\
**Last updated:** [June 28, 2023, 1:51pm UTC](https://forum.elixirforum.com/t/using-dagger-elixir-sdk-to-refactor-a-script/56748 "2023-06-28T13:51:01Z")

</div>

In this post I’d like to share my experience working with Elixir SDK for dagger. dagger positions itself as a “programmable CI”, but I used it to re-write a shell script: using Elixir SDK for dagger, I was able to simpli…

---

## [How to pass strings containing commas to a script using \`mix run\`?](https://forum.elixirforum.com/t/how-to-pass-strings-containing-commas-to-a-script-using-mix-run/51059)

<div class="topic-metadata">

**Author:** [@bmitc](https://forum.elixirforum.com/u/bmitc)\
**Replies:** 5\
**Last updated:** [October 16, 2022, 4:50am UTC](https://forum.elixirforum.com/t/how-to-pass-strings-containing-commas-to-a-script-using-mix-run/51059 "2022-10-16T04:50:27Z")

</div>

Apologies if I am missing something silly, but I am unable to figure this out. I am trying to run an Elixir script using mix run, and I want to pass a single arbitrary string to it. A sample script, say scripts/string\_p…

---

## [Call functions from shell using scripts](https://forum.elixirforum.com/t/call-functions-from-shell-using-scripts/34657)

<div class="topic-metadata">

**Author:** [@Torounia](https://forum.elixirforum.com/u/Torounia)\
**Replies:** 2\
**Last updated:** [September 30, 2020, 7:32pm UTC](https://forum.elixirforum.com/t/call-functions-from-shell-using-scripts/34657 "2020-09-30T19:32:01Z")

</div>

Hi there, I have a script named ListModules.exs that contains the below, defmodule ListModule do def sum(\[\]), do: 0 def sum(\[head | tail\]) do head + sum(tail) end end How can I run the above from a windows…

---

## [Command line: elixir vs mix? How to write a script that has access to all an app's modules?](https://forum.elixirforum.com/t/command-line-elixir-vs-mix-how-to-write-a-script-that-has-access-to-all-an-apps-modules/29750)

<div class="topic-metadata">

**Author:** [@fireproofsocks](https://forum.elixirforum.com/u/fireproofsocks)\
**Replies:** 1\
**Last updated:** [March 10, 2020, 5:48pm UTC](https://forum.elixirforum.com/t/command-line-elixir-vs-mix-how-to-write-a-script-that-has-access-to-all-an-apps-modules/29750 "2020-03-10T17:48:43Z")

</div>

This is perhaps a simple question, but I think it gets at some of the fundamental underpinnings of mix and iex. I’m working on an app where it makes sense to have separate .exs files where users can do some simple (but …

---

## [Run phx.server after seeds with mix alias](https://forum.elixirforum.com/t/run-phx-server-after-seeds-with-mix-alias/28406)

<div class="topic-metadata">

**Author:** [@ppff](https://forum.elixirforum.com/u/ppff)\
**Replies:** 16\
**Last updated:** [January 21, 2020, 12:37pm UTC](https://forum.elixirforum.com/t/run-phx-server-after-seeds-with-mix-alias/28406 "2020-01-21T12:37:35Z")

</div>

Hello there, I’m trying to define a mix alias to clear, recreate and seed my database before starting the phoenix server. Here is my alias config: defp aliases do \[ "ecto.setup": \["ecto.create", "ecto.migr…

---

## [Elixir scripting (.exs, not escript)](https://forum.elixirforum.com/t/elixir-scripting-exs-not-escript/25927)

<div class="topic-metadata">

**Author:** [@ityonemo](https://forum.elixirforum.com/u/ityonemo)\
**Replies:** 6\
**Last updated:** [October 10, 2019, 5:34am UTC](https://forum.elixirforum.com/t/elixir-scripting-exs-not-escript/25927 "2019-10-10T05:34:18Z")

</div>

Every year I help my friend with his taxes, he has an itinerary of places that he’s been to for work and I scrape the google maps API to get driving distances. This year I did it in elixir. The major challenge is figur…

---

## [Escript immediately exits when used as a git pre-push hook](https://forum.elixirforum.com/t/escript-immediately-exits-when-used-as-a-git-pre-push-hook/23477)

<div class="topic-metadata">

**Author:** [@r11na](https://forum.elixirforum.com/u/r11na)\
**Replies:** 6\
**Last updated:** [July 2, 2019, 9:40am UTC](https://forum.elixirforum.com/t/escript-immediately-exits-when-used-as-a-git-pre-push-hook/23477 "2019-07-02T09:40:04Z")

</div>

I’m trying to write a git pre-push hook using elixir I want to be able to read user input when the script executes and then depending on the user input proceed with the push or abort. The problem I’m having is when exc…

---

## [A script to help when releasing new versions for packages](https://forum.elixirforum.com/t/a-script-to-help-when-releasing-new-versions-for-packages/18413)

<div class="topic-metadata">

**Author:** [@tmbb](https://forum.elixirforum.com/u/tmbb)\
**Replies:** 0\
**Last updated:** [December 2, 2018, 3:11pm UTC](https://forum.elixirforum.com/t/a-script-to-help-when-releasing-new-versions-for-packages/18413 "2018-12-02T15:11:02Z")

</div>

Releasing new versions for a package is a chore. You have to run the tests, add a tag to your repo, publish on hex, etc. This is something we should automate. Inspired by this article here: Hypothesis, I’ve written a scr…

---

## [How to prevent genserver to start when running seeds.ex file](https://forum.elixirforum.com/t/how-to-prevent-genserver-to-start-when-running-seeds-ex-file/13926)

<div class="topic-metadata">

**Author:** [@mihai-ciupina](https://forum.elixirforum.com/u/mihai-ciupina)\
**Replies:** 8\
**Last updated:** [April 30, 2018, 11:08am UTC](https://forum.elixirforum.com/t/how-to-prevent-genserver-to-start-when-running-seeds-ex-file/13926 "2018-04-30T11:08:30Z")

</div>

hi, how can I prevent genserver to start when running the seeds.ex file? I have this cronjob that is running when I start the server, but I noticed that it starts too when I run the seeds.ex file. It wouldn’t be so bad…

---

## [Issues with opening port for bash script and automatically closing the process](https://forum.elixirforum.com/t/issues-with-opening-port-for-bash-script-and-automatically-closing-the-process/9981)

<div class="topic-metadata">

**Author:** [@amnu3387](https://forum.elixirforum.com/u/amnu3387)\
**Replies:** 8\
**Last updated:** [November 20, 2017, 8:13pm UTC](https://forum.elixirforum.com/t/issues-with-opening-port-for-bash-script-and-automatically-closing-the-process/9981 "2017-11-20T20:13:52Z")

</div>

Hey, perhaps someone ran into this before and can help me out. Basically I’m opening a port that runs a bash script for launching chrome. It works fine on my local mac, chrome gets started, when the Port is sent Process.…
