From 031817f6d9b544606fb8fac273c7040359851f86 Mon Sep 17 00:00:00 2001 From: Anton Lindqvist Date: Mon, 2 Oct 2017 08:58:42 +0200 Subject: [PATCH] Use eval in example Otherwise, aliases won't be expanded. Pointed out by Jenz Guenther in issue #253. --- README.md | 2 +- pick.1 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 42b25847..623fbf44 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,7 @@ follow the instructions in [DEVELOPING.md][current]. ```sh git ls-files | pick | xargs less # Select a file in the current git repository to view in less cd "$(find . -type d | pick)" # Select a directory to cd into -$(fc -ln 1 | pick) # Select a command from the history to execute +eval "$(fc -ln 1 | pick)" # Select a command from the history to execute ``` Pick can also easily be used from within Vim both using `system()` and `!`. For diff --git a/pick.1 b/pick.1 index 4781c74f..50d65474 100644 --- a/pick.1 +++ b/pick.1 @@ -117,7 +117,7 @@ Select a file in the current directory to open using .Pp Select a command from the history to execute: .Pp -.Dl $ $(fc -ln 1 | pick) +.Dl $ eval \&"$(fc -ln 1 | pick)\&" .Sh DIAGNOSTICS .Ex -std .Sh HISTORY