If you want to change the shell, run chsh -s /bin/bash
If you want to run the shell once while logged in as root just run bash
or /bin/bash
chsh
after changing roots shell:
# Changing user information for root.
# Use "passwd" to change the password.
##
# Open Directory: /Local/Default
##
Login: root
Uid [#]: 0
Gid [# or name]: 0
Generated uid: FFFFEEEE-DDDD-CCCC-BBBB-AAAA00000000
Home directory: /var/root
Shell: /bin/bash
Full Name: System Administrator
Office Location:
Office Phone:
Home Phone:
This looks like a bug in several shells, it works as expected with ksh93 and zsh.
Background:
Most shells seem to run the while loop inside the main shell and
Bourne Shell suspends the whole shell if you type ^Z with a non-login shell
bash suspends only the sleep
and then leaves the while loop in favor of printing a new shell prompt
dash makes this command unsuspendable
With ksh93, things work very different:
ksh93 does the same, while the command is started the first time, but as sleep
is a buitin in ksh93, ksh93 has a handler that causes the while loop to fork off the main shell and then suspend at the time when you type ^Z.
If you in ksh93 later type fg
, the forked off child that still runs the loop is continued.
You see the main difference when comparing the jobcontrol messages from bash and ksh93:
bash reports:
[1]+ Stopped sleep 1
but ksh93 reports:
^Z[1] + Stopped while true; do echo .; sleep 1; done
zsh behaves similar to ksh93
With both shells, you have a single process (the main shell) as long as you don't type ^Z, and two shell processes after you typed ^Z.
Best Answer
From the
bash
manual (with my emphasis):Brace expansions with letters as ranges allows for mixed-case ranges in
bash
. So what you are seeing are the characters betweenG
anda
in the ASCII table (with a default 1 increment as the values occur in that order in the table).Between the last uppercase character (
Z
) and the first lowercase character (a
) in the standard ASCII table, there are the charactersin this order.
You do not get
\
in your output as the shell would treat an escaped space character as a literal space. Also note that since an unquoted backtick is outputted, this could potentially lead to unexpected code execution, as pointed out by Stéphane in a message to thebug-bash
mailing list in 2015.I do however not quite know what the manual refers to as "type", but my guess would be that you can't use a letter and a digit, as in
{1..z}
(which indeed does not expand).