~ sh
$ dash
$ quit
dash: 1: quit: not found
$ bash
[email protected]:~$ exit
exit
$ exit
$
いずれの回答も高く評価されます。Ubuntuシェルで '〜'と '〜>〜'の違いは何ですか?
~ sh
$ dash
$ quit
dash: 1: quit: not found
$ bash
[email protected]:~$ exit
exit
$ exit
$
いずれの回答も高く評価されます。Ubuntuシェルで '〜'と '〜>〜'の違いは何ですか?
デフォルトシェル - あなたはbashのコマンドを入力しながら> zshのは、あなたがSHを入力すると、Ubuntuのデフォルトのシェルはダッシュで、あなたは、ダッシュのコマンドがない
ls -l /bin/sh
output:
/bin/sh -> /bin/dash
が終了してそれを得ることができますbash環境を入力し、exitはbashコマンドです。同じ結果を得るには/ bin/sh/bin/bashへのシンボリックリンクを変更できます。
どちらもシェルプロンプトです.1つはdash
、もう1つはbash
です。 bash
とdash
の両方とも、同じブートプロンプトを持つように設定することができます(そのようなプロンプトの任意の性質を示す、あなたが望むものではありませんが、実行できることを示すために)。$PS1
変数を調整します。 man bash
から:
PS1 The value of this parameter is expanded (see PROMPTING below)
and used as the primary prompt string. The default value is
``\s-\v\$ ''.
PS2 The value of this parameter is expanded as with PS1 and used as
the secondary prompt string. The default is ``> ''.
PS3 The value of this parameter is used as the prompt for the select
command (see SHELL GRAMMAR above).
PS4 The value of this parameter is expanded as with PS1 and the
value is printed before each command bash displays during an
execution trace. The first character of PS4 is replicated mul‐
tiple times, as necessary, to indicate multiple levels of indi‐
rection. The default is ``+ ''.
(スペースを表示するために2つのコロンの間に)プロンプトの様々なレベルを印刷するために、dash
とbash
に以下for
ループを実行してみてください。 dash
に表示される内容は次のとおりです。
for f in PS1 PS2 PS3 PS4 ; do eval echo :\$$f: ; done
:$ :
:> :
::
:+ :
この質問には、リンクするのではなく、このスクリーンショットを含めてください。あるいは、端末からテキストをコピーするほうがよい –