Stable v3.3.7

🐚 fortsh

Modern POSIX-compliant shell written in Fortran 2018

A production-ready shell demonstrating that Fortran can handle modern systems programming. Achieves ~99% bash compatibility with all POSIX.1-2017 required features, plus modern UX features like syntax highlighting, autosuggestions, and fuzzy search. Built from ~70,000 lines of Fortran across 116 source files.

🎯 RPM Available 🏛️ AUR Available

Features

Installation

RPM (Fedora/RHEL/CentOS)

terminal
$sudo dnf config-manager --add-repo https://repos.musicsian.com/musicsian.repo
$sudo dnf install fortsh

AUR (Arch Linux)

terminal
$yay -S fortsh

From Source

terminal
$git clone https://github.com/FortranGoingOnForty/fortsh.git
$cd fortsh
$make# debug build
$make release# optimized build
$sudo make install# installs to /usr/local/bin

Build Options

Target Description
make Debug build with assertions
make release Optimized production build (-O2)
make clean Remove build artifacts
make test Run test suite

macOS ARM64 (M1/M2/M3)

Must use LLVM Flang instead of gfortran due to compiler bugs:

$brew install llvm
$export PATH="/opt/homebrew/opt/llvm/bin:$PATH"
$make clean && make

Note: Command lines limited to 127 characters on ARM64 (compiler limitation).

Quick Start

terminal
$fortsh# launch interactive shell
$fortsh script.sh# run a script
$fortsh -c 'echo "Hello"'# execute command string
$fortsh -n script.sh# syntax check only

First Run

On first interactive run, fortsh offers to create default configuration files. Accept to create ~/.fortshrc with sensible defaults.

CLI Flags

Flag Description
-c 'cmd' Execute command string
-n Syntax check only (no execution)
-l, --login Login shell mode
-i Force interactive mode
--version Show version
--help Show help

Setting as Default Shell

terminal
$which fortsh
/usr/local/bin/fortsh
$sudo sh -c 'echo /usr/local/bin/fortsh >> /etc/shells'# add to valid shells
$chsh -s /usr/local/bin/fortsh# set as default

← Back to all packages