Skip to content

Releases: shellgei/rusty_bash

v0.10.2

05 Jan 08:34
Compare
Choose a tag to compare

Implemented builtin printf

I hastily implemented to use bash_completion. The difference toward the external command is the existence of -v option.

🍣 printf -v aaa bbb
🍣 echo $aaa
bbb
🍣 printf -v a[5] abc
🍣 echo ${a[5]}
abc

v0.10.0

24 Dec 09:01
Compare
Choose a tag to compare

Supported <<< (here string)

Here you are.

🍣 rev <<< 123
321
🍣 rev <<< $(seq 100 103)
001
101
201
301
🍣 seq 100 | rev <<< $(seq 100 103) | tac
301
201
101
001

v0.9.10

22 Dec 04:14
Compare
Choose a tag to compare

Fixed a serious bug on alias

Aliases have been wrongly applied to args of a command on v0.9.9 or before.

### <= v0.9.9 ###
🍣 echo ll
ls --color=auto -al
### v0.9.10 ###
🍣 echo ll
ll

v0.9.9

22 Dec 02:34
Compare
Choose a tag to compare

Supported complete -c

You can use command completion for the commands listed after complete -c. Here is an example.

🍣 complete -c sudo which
🍣 sudo pas
passwd paste   #<---candidates for completion
🍣 which find
find     findfs   findhyph findmnt  findrule    #<---candidates for completion

You can use ~/.sushrc to write complete -c ... for initialization.

v0.9.7

14 Dec 02:35
Compare
Choose a tag to compare

Enabled to use associative arrays

like this:

🍣 declare -A X
🍣 X[abc]=123
🍣 X[def]=456
🍣 echo ${X[def]}
456
🍣 echo ${X[@]}
123 456
🍣 Y=abc
🍣 echo ${X[$Y]}
123

Enjoy!

v0.9.4

01 Dec 04:11
Compare
Choose a tag to compare

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

20 Nov 11:21
Compare
Choose a tag to compare

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

14 Nov 05:48
Compare
Choose a tag to compare

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. So core.tty_fd is duplicated from fd0 in this version.

v0.8.11

10 Nov 12:04
Compare
Choose a tag to compare

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

10 Nov 06:54
Compare
Choose a tag to compare

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