Last active
October 20, 2020 09:52
-
-
Save kotet/0a918458de46b648c0b161312659c365 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
#!/bin/bash | |
file-select() { | |
( | |
cd "${1}" | |
path=$(ls -a | peco) | |
path=$(readlink -f "${path}") | |
if [[ -d "${path}" ]]; then | |
file-select "${path}" | |
elif [[ -f "${path}" ]]; then | |
echo "${path}" | |
else | |
exit 1 | |
fi | |
) | |
} | |
file-select "${1:-pwd}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment