官术网_书友最值得收藏!

  • Bash Quick Start Guide
  • Tom Ryder
  • 192字
  • 2021-07-23 16:58:53

Checking Bash is running

If you're using a GNU/Linux system, and your system administrator hasn't changed your login shell, it's likely that Bash is starting up as soon as you log in with a TTY, in an xterm, or over SSH.

If you see a prompt that looks like one of these after you log in, it's a good sign you're in a bash session:

bash-4.4$
user@hostname:~$

If you want to check, you can enter this at the prompt:

bash$ declare -p BASH

If you get a response like this, with a path to your bash binary, you can be confident you are running bash:

declare -- BASH="/bin/bash"

If you get some other output, such as:

sh: declare: not found

Then you may be running some other kind of shell. You may be able to tell what it is by printing the value of the SHELL variable:

$ echo "$SHELL"

We'll use the bash$ prefix before commands throughout this book as a way to show commands you should enter at the Bash command line. We'll use just a $ prefix instead if the command should also work in other POSIX-compliant shells.

主站蜘蛛池模板: 涪陵区| 阆中市| 武冈市| 新津县| 县级市| 西贡区| 三台县| 福安市| 拜泉县| 建阳市| 盈江县| 新余市| 东港市| 黄山市| 石景山区| 乌鲁木齐县| 牟定县| 闽侯县| 花莲县| 确山县| 东山县| 康定县| 阿拉善盟| 白河县| 余干县| 澄江县| 涞源县| 恩平市| 沿河| 左权县| 余干县| 焦作市| 英德市| 四会市| 兰州市| 来安县| 东乌珠穆沁旗| 北流市| 金溪县| 金湖县| 文安县|