LoginSignup
1
1

More than 1 year has passed since last update.

#Mac のコンソールでコマンドの結果をシェル変数に代入する、クリップボードにコピーする、標準出力もする ( #Shell )

Last updated at Posted at 2020-02-07
result=$(some_command) && echo "$result" | pbcopy && pbpaste

$ result=$(ls) && echo "$result" | pbcopy && pbpaste
./
../
a.txt
b.txt

コンソールで変数を出力

$ echo "$result"
./
../
a.txt
b.txt

他のエディタ、アプリでペースト

image

Original by Github issue

チャットメンバー募集

何か質問、悩み事、相談などあればLINEオープンチャットもご利用ください。

Twitter

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1