Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私はこのコード行を持っています:
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
違いはありますか
eval "$(SHELL=/bin/sh lesspipe)"
もっと簡単に
SHELL=/bin/sh lesspipe
export SHELL=/bin/sh lesspipe
(ちなみに使うのと使わないの違いは何exportですか?)
export
はい、違いがあります。
2 番目の例は、その環境で変数を に設定しlesspipeて実行するだけです。SHELL/bin/sh
lesspipe
SHELL
/bin/sh
最初の例は同じことを行いますが、出力を受け取り、それを現在のシェルでコマンドとして実行します。