view bin/f @ 11295:0b054ddeff49

<wob_jonas> perl -eopen$i,"<",($f="wisdom/aristotle");$_=<$i>; s/(fifth) kind of vitreous/$1/ or die; if (1) { open$o,">",$f; print$o $_ or die; } print substr$_,200;
author HackBot
date Mon, 01 Jan 2018 18:01:49 +0000
parents c989a1669243
children
line wrap: on
line source

#! /bin/bash
cmd="$1"
shift
f="$*"
if [[ -z "$f" && "$cmd" == *\ * ]]; then f="${cmd#* }"; cmd="${cmd%% *}"; fi
if [[ -z "$f" ]]; then echo try: \`f command filename; elif [[ -e "$f" ]]; then "$cmd" "$(< "$f")"; else echo no such file: "$f"; fi