#!/usr/bin/env sh # Description: Search file with fzf # # Dependencies: fzf # # Shell: POSIX compliant # # Author: Shi Yanling sffpipe=$1 PWD=${PWD:-$(pwd)} sffpipe_enter_dir() { printf ">%s\0" "$1" >"$sffpipe" } if ! fzf --version >/dev/null; then printf "Press Enter to continue "; read -r _x exit 0 fi _path=$(fzf) [ "$_path" ] && sffpipe_enter_dir "${PWD}/$_path"