LoginSignup
5
4

More than 5 years have passed since last update.

Qiita > syntax-highlighting > bashとshell-sessionの違い

Last updated at Posted at 2018-03-31

比較1

shell-session

$ ls -lrt
$ history
 2052  cd 170722_learn_realm_imagm/
 2053  ls
 2054  python3 learn_mr_mi_170819.py 

bash

$ ls -lrt
$ history
 2052  cd 170722_learn_realm_imagm/
 2053  ls
 2054  python3 learn_mr_mi_170819.py 

どちらを使うか?

プレビュー画面では下図のように違いが分かりやすい。

qiita.png

記事になった時点で見やすさが低下しているように思われる。

  • コマンドの色がなくなる
  • 実行結果の薄色表示がなくなる (shell-session)
  • オプションに色がつく
    • -lrtに目がもってかれる

読者の読みやすい書き方:未調査

比較2

keep_env_180106_exec
#!/usr/bin/env bash

addacfg="-grid 32 -eq_rad 4.24478229"

echo $addacfg

上記を実行した場合。

shell-session
$ bash -x keep_env_180106_exec 
+ addacfg='-grid 32 -eq_rad 4.24478229'
+ echo -grid 32 -eq_rad 4.24478229
-grid 32 -eq_rad 4.24478229
bash
$ bash -x keep_env_180106_exec 
+ addacfg='-grid 32 -eq_rad 4.24478229'
+ echo -grid 32 -eq_rad 4.24478229
-grid 32 -eq_rad 4.24478229
txt
$ bash -x keep_env_180106_exec 
+ addacfg='-grid 32 -eq_rad 4.24478229'
+ echo -grid 32 -eq_rad 4.24478229
-grid 32 -eq_rad 4.24478229
5
4
2

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
5
4