๋๋ macOS์์ ๋ฌธ์ ์์ด ์ค๋ซ๋์ fasd๋ฅผ ์ฌ์ฉํด ์์ต๋๋ค. ์ต๊ทผ์ ์ด์ ๋ฒ์ ์ macOS์ ์ด์ ๋ฒ์ ์ fasd์์ ์ ๋ฐ์ดํธ๋ฅผ ์กฐํฉํ์ฌ ์ํํ์ต๋๋ค. ์ด์ fasd๊ฐ ์ ๋๋ก ์๋ํ์ง ์์ต๋๋ค.
eval "$(fasd --init auto)"
์ค๋ฅ ์์ด ์คํ๋๊ณ , fasd๋ ๋ฒ์ ์ด ์๋ ๊ฒ ๊ฐ์ต๋๋ค. ~/.fasd
ํ์ผ์ด ์ด๋ฏธ ์กด์ฌํ์ง ์์ผ๋ฉด fasd๊ฐ ์์ฑํฉ๋๋ค. ๊ทธ๋ฌ๋ fasd๋ ํด๋น ํ์ผ์ ์ฐ์ง ์์ผ๋ฉฐ ํญ์ 0๋ฐ์ดํธ ํฌ๊ธฐ๋ฅผ ๊ฐ์ต๋๋ค.
MacBook-Air:~/$ ls .fasd
ls: .fasd: No such file or directory
MacBook-Air:~/$ fasd --version
1.0.1
MacBook-Air:~/$ cd Downloads
MacBook-Air:Downloads/$ cd
MacBook-Air:~/$ ls .fasd
-rw------- 1 henry staff 0B Aug 23 15:12 .fasd
MacBook-Air:~/$ cd Pictures
MacBook-Air:Pictures/$ cd ..
MacBook-Air:~/$ ls .fasd
-rw------- 1 henry staff 0B Aug 23 15:12 .fasd
README์ ๋๋ฒ๊น ์น์ ์ ์ค๋ช ๋ ๋๋ก ๋ช ๊ฐ์ง ์ถ๊ฐ ์ ๋ณด๋ฅผ ์ ๊ณตํ๋ ๊ฒ์ด ์ข์ต๋๋ค. ๊ทํ์ ๋ฌธ์ ๋ ๋ฌด์์ ์ฐพ์์ผ ํ๋์ง ์๊ณ ์์ง๋ง ๊ณ์ ์งํํด์ผ ํ ์ฌํญ์ด ํ์ํ ์ฌ๋๋ค์๊ฒ ๋น ๋ฅด๊ฒ ์๋ ค์ง ์ ์์ต๋๋ค.
๋ํ echo $_FASD_RO
๋ฅผ ์คํํ ๋ ์ป๋ ๊ฒฐ๊ณผ๊ฐ ๊ถ๊ธํฉ๋๋ค. ๋น์ด ์์ง ์์ ๋ฌธ์์ด์ด๋ฉด fasd๋ ๋ฐ์ดํฐ๋ฒ ์ด์ค์ ์ฐ์ง ์์ต๋๋ค.
๋น์ ์ ์๋ต์ ์ฃผ์
์ ๊ฐ์ฌํฉ๋๋ค! ๋๋ฒ๊น
์น์
์ ๋ณด์ง ์์๊ณ _FASD_SINK
๋ํด ์์ง ๋ชปํ์ต๋๋ค.
๋ฒ์ธ์ awk์ ๊ตฌ์ ๋ฒ์ ์ธ ๊ฒ์ผ๋ก ๋ฐํ์ก์ต๋๋ค(์ฌ์ค ์ ๋ macOS์์ gawk).
brew upgrade gawk
ํ๊ณ ์ด์ fasd
๊ฐ ์์๋๋ก ์๋ํฉ๋๋ค. ๋์์ฃผ์
์ ๊ฐ์ฌํฉ๋๋ค!
MacBook-Air:~/$ cat .fasd.log
fasd -U -V fasd -K _fasd_zsh_cmd_complete -x 'C[-1,-*e] , s[-] n[1,e]' -c - 'c[-1,-A][-1,-D]' -f
fasd_cd -U -V fasd -K _fasd_zsh_cmd_complete -x 'C[-1,-*e] , s[-] n[1,e]' -c - 'c[-1,-A][-1,-D]' -f
COMMAND -c -tn
DEFAULT -f -tn
FIRST
/usr/local/bin/fasd: line 341: -v: command not found
MacBook-Air:~/$ which fasd
/usr/local/bin/fasd
MacBook-Air:~/$ vim /usr/local/bin/fasd
MacBook-Air:~/$ echo $_FASD_AWK
MacBook-Air:~/$ echo $_FASD_AWK
MacBook-Air:~/$ awk
dyld: Library not loaded: /usr/local/opt/mpfr/lib/libmpfr.4.dylib
Referenced from: /usr/local/bin/awk
Reason: image not found
[1] 59913 abort awk
MacBook-Air:~/$ brew search mpfr
==> Formulae
mpfr โ
==> Casks
mpfreaker
MacBook-Air:~/$ gawk
dyld: Library not loaded: /usr/local/opt/mpfr/lib/libmpfr.4.dylib
Referenced from: /usr/local/bin/gawk
Reason: image not found
[1] 61358 abort gawk
MacBook-Air:~/$ brew upgrade gawk
Updating Homebrew...
...
==> Upgrading 1 outdated package, with result:
gawk 4.1.4_1 -> 4.2.1
==> Upgrading gawk
==> Downloading https://homebrew.bintray.com/bottles/gawk-4.2.1.high_sierra.bott
######################################################################## 100.0%
==> Pouring gawk-4.2.1.high_sierra.bottle.tar.gz
๐บ /usr/local/Cellar/gawk/4.2.1: 85 files, 4.7MB
MacBook-Air:~/$ gawk
Usage: gawk [POSIX or GNU style options] -f progfile [--] file ...
Usage: gawk [POSIX or GNU style options] [--] 'program' file ...
POSIX options: GNU long options: (standard)
-f progfile --file=progfile
-F fs --field-separator=fs
-v var=val --assign=var=val
...
MacBook-Air:~/$ fasd
MacBook-Air:~/$ vim .fasd.log
MacBook-Air:~/$ awk
Usage: awk [POSIX or GNU style options] -f progfile [--] file ...
Usage: awk [POSIX or GNU style options] [--] 'program' file ...
POSIX options: GNU long options: (standard)
-f progfile --file=progfile
-F fs --field-separator=fs
-v var=val --assign=var=val
...
MacBook-Air:~/$ awk
Usage: awk [POSIX or GNU style options] -f progfile [--] file ...
Usage: awk [POSIX or GNU style options] [--] 'program' file ...
POSIX options: GNU long options: (standard)
-f progfile --file=progfile
-F fs --field-separator=fs
-v var=val --assign=var=val
...
MacBook-Air:~/$ fasd
6 /home/henry/.fasd.log
๊ฐ์ฌํฉ๋๋ค. line 457: -v: command not found
์ค๋ฅ๋ ์์์ต๋๋ค.
brew upgrade gawk
์์ ํ์ต๋๋ค!
๊ฐ์ฅ ์ ์ฉํ ๋๊ธ
๋น์ ์ ์๋ต์ ์ฃผ์ ์ ๊ฐ์ฌํฉ๋๋ค! ๋๋ฒ๊น ์น์ ์ ๋ณด์ง ์์๊ณ
_FASD_SINK
๋ํด ์์ง ๋ชปํ์ต๋๋ค.๋ฒ์ธ์ awk์ ๊ตฌ์ ๋ฒ์ ์ธ ๊ฒ์ผ๋ก ๋ฐํ์ก์ต๋๋ค(์ฌ์ค ์ ๋ macOS์์ gawk).
brew upgrade gawk
ํ๊ณ ์ด์ fasd
๊ฐ ์์๋๋ก ์๋ํฉ๋๋ค. ๋์์ฃผ์ ์ ๊ฐ์ฌํฉ๋๋ค!