Releases: shellgei/rusty_bash
Releases Β· shellgei/rusty_bash
v0.9.7
v0.9.4
Implemented continue command
Like this:
### skip "echo NG" after the continue command ###
π£ seq 2 | while read d ; do echo x; continue; echo NG ; done
x
x
### skip the outer loop with continue <num> ###
π£ seq 2 | while read d ; do for a in a b ; do echo x; continue 2 ; done ; echo NG ; done
x
x
v0.9.2
Implemented some features
SECONDS, EPOCHSECONDS, EPOCHREALTIME
These variables are implemented by @t-koba .
- SECONDS: time elapsed from the shell starts
- EPOCHSECONDS: unixtime
- EPOCHREALTIME: unixtime with microsecond
π£ echo $SECONDS, $EPOCHSECONDS, $EPOCHREALTIME
2161, 1732101153, 1732101153.551434
enabled to use [0-9], [a-z], and [A-Z] in glob patterns
These wildcards are omitted in previous implementations.
π£ ls
Cargo.lock Cargo.toml LICENSE README.md RELEASE.md build.rs src target test
π£ ls [A-D]*
Cargo.lock Cargo.toml
π£ ls -d [!A-D]*
LICENSE README.md RELEASE.md build.rs src target test
v0.9.0
Fixed bugs on shell script execution
- In the previous implemetation, we have used fd0 for reading shell scripts. This crude implementation has made fd0 unusable for reading data and has been the reasons of some errors.
core.tty_fd
, which was duplicated from fd2, doesn't point tty if fd2 of a shell script was redirected to a file. This was a cause of bugs when a command is forked from the shell script. Socore.tty_fd
is duplicated from fd0 in this version.
v0.8.11
Fixed bugs
- Fixed no reaction toward an index designation on referring a special parameter
### before ###
π£ echo ${@[1]}
π£ echo $?
0
### after ###
π£ echo ${@[1]}
sush: ${@[1]}: bad substitution
π£ echo $?
1
- Fixed wrong word splitting on
$@ and $ {array[@]} in a double quoted subword
### before ###
π£ set a b c ; for x in "@$@x" ; do echo $x ; done
@a
b
### after ###
π£ set a b c ; for x in "@$@x" ; do echo $x ; done
@a
b
cx
v0.8.10
Supported ${name/pattern/word}, ${name//pattern/word}, ${name/#pattern/word}, and ${name/%pattern/word}
Here are the examples:
π£ echo $BASH_VERSION
0.8.10(rusty_bash)-release
### replace once ###
π£ echo ${BASH_VERSION/0/X}
X.8.10(rusty_bash)-release
### replace all ###
π£ echo ${BASH_VERSION//0/X}
X.8.1X(rusty_bash)-release
### head only replace ###
π£ echo ${BASH_VERSION/#0*8/X}
X.10(rusty_bash)-release
π£ echo ${BASH_VERSION/#release/X}
0.8.10(rusty_bash)-release
### tail only replace ###
π£ echo ${BASH_VERSION/%release/X}
0.8.10(rusty_bash)-X
π£ echo ${BASH_VERSION/%0/X}
0.8.10(rusty_bash)-release
v0.8.9
Supported RANDOM
π£ echo $RANDOM
28778
π£ echo $RANDOM
22003
π£ echo $RANDOM
7483
v0.8.7
Supported command-not-found
example
ueda@uedax1:mainπ΅~/GIT/rusty_bashπ£ aaa
Command 'aaa' not found, did you mean:
command 'ara' from deb python3-ara (1.5.8-1.1ubuntu1)
command 'ava' from deb ava (5.3.1+dfsg+~cs46.3.10-3)
command 'jaaa' from deb jaaa (0.9.2-1)
command 'aha' from deb aha (0.5.1-3)
command 'aa' from deb astronomical-almanac (5.6-7)
Try: sudo apt install <deb name>
sush: aaa: command not found
how to use
Please write the following code to .sushrc at your home directory.
command_not_found_handle() {
/usr/lib/command-not-found -- "$1" # change the path to the command-not-found path on your environment
}
v0.8.5
Supported ${name#word}, ${name##word}, ${name%word}, ${name%%word}
Examples:
π£ A=usr/local/bin/bash; echo ${A#*/}
local/bin/bash
π£ A=usr/local/bin/bash; echo ${A##*/}
bash
π£ A=usr/local/bin/bash; echo ${A%/*}
usr/local/bin
π£ A=usr/local/bin/bash; echo ${A%%/*}
usr
v0.8.4
Supported ${name:offset:length}
Like this.
π£ A=hello
π£ echo ${A:1}
ello
π£ echo ${A:0:4}
hell
π£ B=γγγγγ
π£ echo ${B:4}
γ
π£ echo ${B:0:2}
γγ