Mercurial > repo
comparison bin/f @ 9075:c989a1669243
<fizzie> revert 58b9ee8f97a7
author | HackBot |
---|---|
date | Sun, 25 Sep 2016 20:31:46 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
9074:560a73f4f0a4 | 9075:c989a1669243 |
---|---|
1 #! /bin/bash | |
2 cmd="$1" | |
3 shift | |
4 f="$*" | |
5 if [[ -z "$f" && "$cmd" == *\ * ]]; then f="${cmd#* }"; cmd="${cmd%% *}"; fi | |
6 if [[ -z "$f" ]]; then echo try: \`f command filename; elif [[ -e "$f" ]]; then "$cmd" "$(< "$f")"; else echo no such file: "$f"; fi |