Created
January 5, 2015 02:11
-
-
Save junegunn/42d2285580c9890e0fd6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
output=$(fzf --print-query --multi) | |
mapfile -t lines <<< "$output" | |
query="${lines[0]}" | |
matches=(${lines[@]:1}) | |
echo "Query: $query" | |
if [ ${#matches[@]} -eq 0 ]; then | |
echo "- No result" | |
else | |
echo "Results:" | |
for match in "${matches[@]}"; do | |
echo "- $match" | |
done | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment