Mercurial > repo
changeset 7764:de0c23a5db21
<fizzie> ` echo -e \'#! /bin/bash\\ncmd="$1"\\nshift\\nf="$*"\\nif [[ -z "$f" && "$cmd" == *\\\\ * ]]; then f="${cmd#* }"; cmd="${cmd%% *}"; fi\\nif [[ -z "$f" ]]; then echo try: \\\\`f command filename; elif [[ -e "$f" ]]; then "$cmd" "$(< "$f")"; else echo no such file: "$f"; fi\' > bin/f
author | HackBot |
---|---|
date | Wed, 04 May 2016 21:42:02 +0000 |
parents | 6abca43f97a0 |
children | f9fd2ce12a6e |
files | bin/f |
diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/bin/f Wed May 04 21:39:37 2016 +0000 +++ b/bin/f Wed May 04 21:42:02 2016 +0000 @@ -3,4 +3,4 @@ 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 echo no such file: "$f"; else "$cmd" "$(< "$f")"; fi +if [[ -z "$f" ]]; then echo try: \`f command filename; elif [[ -e "$f" ]]; then "$cmd" "$(< "$f")"; else echo no such file: "$f"; fi