Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
rustshellscript
searching Neon…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
5 ms
·
1.
▲
A new metadata engine for high performance Object Storage (not LSM, not B+ tree)
(fractalbits.com)
8 points
by
rustshellscript
3mo ago
|
0 comments
2.
▲
by
rustshellscript
3y ago
You can check https://github.com/rust-shell-script/rust_cmd_lib
3.
▲
by
rustshellscript
3y ago
Here: https://github.com/rust-shell-script/rust_cmd_lib
4.
▲
by
rustshellscript
5y ago
Here is the rust library with the “the only good parts” of bash/shell script: https://github.com/rust-shell-script/rust_cmd_lib
5.
▲
by
rustshellscript
5y ago
The only good part of sh/bash script is to run commands with piping/redirection support IMO,other than that I saw posts like this to explain sh/bash script’s puzzles/pitfalls all the time. Maybe it is time to consider us
6.
▲
by
rustshellscript
5y ago
zsh is also doing the variable substitution better than bash. FYI, I just released rust_cmd_lib 1.0 recently, which can do variable substitution without any quotes: https://github.com/rust-shell-script/rust_cmd_lib
7.
▲
by
rustshellscript
6y ago
I have developed a similar library before: https://github.com/rust-shell-script/bash_cmd_lib/blob/maste... which can do temp files cleanup, different levels ofreporting and redirecting all error msgs into log
8.
▲
by
rustshellscript
6y ago
Thanks Steve. I have studied the "200 lines" book a few days ago, but was still confused. Only after seeing your talks, everything becomes so much clearer. These talks should really be part of the "async book" :)
9.
▲
Futures Explained in 200 Lines of Rust
(cfsamson.github.io)
4 points
by
rustshellscript
6y ago
|
0 comments
10.
▲
by
rustshellscript
6y ago
I have created a similar library for bash. However, there are more pitfalls related to errexit, see [1] and even shellcheck can not help there. I have tried to solve the pitfalls in my library, but it turned out to be ugly and unreliable. T
11.
▲
by
rustshellscript
6y ago
Unquoted argument is not an issue here, see some examples here: https://github.com/rust-shell-script/rust_cmd_lib/issues/10
12.
▲
by
rustshellscript
6y ago
since run_cmd! and run_fun! are returning result type, you can always do let _ = run_cmd!(ls nofile); to ignore single command error. The “xxx || true” is for ignoring error within a group of commands, which is also very common in sh “set -
13.
▲
by
rustshellscript
6y ago
It can be supported with internal APIs, even without macros: Cmds::from_cmd(Cmd(...).current_dir(..)) .pipe(Cmd(...).current_dir(...)) .run_cmd(...) As you can see, it is very verbose and that's why I choose to hide the lower APIs at t
14.
▲
by
rustshellscript
6y ago
Thanks, yes since I just finished the core functionality of this project and I am not surprised if it is still missing some critical features when converting bash script. Pls file bugs if you find anything :)
15.
▲
by
rustshellscript
6y ago
You can consider it was enabled by default, and any failed command would return error unless you mask it with “xx || true”.
16.
▲
by
rustshellscript
6y ago
Yes, I also use this for automatically capturing command error messages with timestamps into logs: https://github.com/rust-shell-script/bash_cmd_lib/blob/0b0a6... However this can be fragile in bash script si
17.
▲
by
rustshellscript
6y ago
Author here, thanks for your feedback. This library is calling std::process::command underneath without any shell dependency, which I believe is the same as plumbum’s run* APIs and I should make it clearer in the docs. This plumbum has its
18.
▲
Show HN: Using Rust to write shell-script like tasks
(github.com)
231 points
by
rustshellscript
6y ago
|
80 comments
19.
▲
by
rustshellscript
7y ago
I am recently working on a hobby programming language: https://github.com/rust-shell-script/rust-shell-script , which could compile to either rust code or shell script. This book helps me clarified a lot of things alon