ATF-SH(1)

πŸ“¦
version 0.23 Β· 3 versions
, in alpine 3.22, alpine 3.23, alpine 3.24, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ ATF-SH(1) ✨

ok so bestie, welcome to the manual page for atf-sh, which lives in the General Commands Manual section (section 1, obvs πŸ’…).


πŸ’– NAME πŸ’–

atf-sh β€” the interpreter for shell-based test programs. that's literally it. she runs your shell test scripts and she's iconic for it πŸŽ€


🌸 SYNOPSIS 🌸

atf-sh [-s shell] script

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea β˜• β€” atf-sh is an interpreter that runs the test program you hand it in script, right after it loads up the atf-sh(3) library. slay.

but ngl, atf-sh is not a real interpreter. like, not even a little. she's just a wrapper around the system-wide shell that's defined by ATF_SHELL. that's the whole vibe πŸ’€

what she actually does: atf-sh executes the interpreter, loads the atf-sh(3) library, and then runs the script. and you must consider atf-sh to be a POSIX shell by default, so bestie... do not be using any non-standard extensions, okay? she said POSIX and she meant it 🫢

the following options are available:

  • -s shell β€” specifies the shell to use instead of the value provided by ATF_SHELL. yes, you get to choose ✨

πŸ’œ ENVIRONMENT πŸ’œ

  • ATF_LIBEXECDIR β€” overrides the builtin directory where atf-sh is located. πŸ‘‘ Should not be overridden other than for testing purposes. like, seriously. leave her alone.
  • ATF_PKGDATADIR β€” overrides the builtin directory where libatf-sh.subr is located. also should not be overridden other than for testing purposes. same energy, same warning πŸ’…
  • ATF_SHELL β€” path to the system shell to be used in the generated scripts. and listen up: scripts must not rely on this variable being set to select a specific interpreter. no cap. don't do it. πŸ™ˆ

🌈 EXAMPLES 🌈

scripts using atf-sh(3) should start with:

#! /usr/bin/env atf-sh

ok but what if you want to explicitly choose a shell interpreter? πŸ‘€ well, plot twist: you cannot rely on env(1) to find atf-sh. nope. instead, you have to hardcode the path to atf-sh in the script, and then use the -s option afterwards as a single parameter:

#! /path/to/bin/atf-sh -s/bin/bash

see how that works? hardcoded path, then -s glued to the shell. it's giving main character energy honestly πŸ’…βœ¨


πŸŽ€ SEE ALSO πŸŽ€


and that's the whole page, bestie β€” every last flag, every env var, every warning, all of it. you're so welcome 🫢

this one comes from the Debian crew, dated September 27, 2014, and it's filed under ATF-SH(1) in the General Commands Manual. periodt. πŸ’–βœ¨πŸŒΈπŸ¦‹πŸŽ€

πŸ“¦ where this page comes from