annotate bin/f @ 12268:6bbbe2a95120 draft

<b_jonas> slashlearn euclid//Euclid is a short geeky game in which the goal is to do Euclidean compass and straightedge constructions in as few steps as possible. It runs in the browser, found at "http://www.euclidthegame.com/". It was popular among #esoteric regulars in 2016-07.
author HackEso <hackeso@esolangs.org>
date Mon, 16 Dec 2019 23:02:52 +0000
parents c989a1669243
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
9075
c989a1669243 <fizzie> revert 58b9ee8f97a7
HackBot
parents:
diff changeset
1 #! /bin/bash
c989a1669243 <fizzie> revert 58b9ee8f97a7
HackBot
parents:
diff changeset
2 cmd="$1"
c989a1669243 <fizzie> revert 58b9ee8f97a7
HackBot
parents:
diff changeset
3 shift
c989a1669243 <fizzie> revert 58b9ee8f97a7
HackBot
parents:
diff changeset
4 f="$*"
c989a1669243 <fizzie> revert 58b9ee8f97a7
HackBot
parents:
diff changeset
5 if [[ -z "$f" && "$cmd" == *\ * ]]; then f="${cmd#* }"; cmd="${cmd%% *}"; fi
c989a1669243 <fizzie> revert 58b9ee8f97a7
HackBot
parents:
diff changeset
6 if [[ -z "$f" ]]; then echo try: \`f command filename; elif [[ -e "$f" ]]; then "$cmd" "$(< "$f")"; else echo no such file: "$f"; fi