NNB/shell_on_ruby
Archived
2
1
Fork
You've already forked shell_on_ruby
0

TODO #1

Closed
opened 2023年05月21日 10:06:53 +02:00 by NNB · 2 comments
Owner
Copy link

If the shell-command's name dosen't match with any command existing commands, it can be write like the following:

Note

If there is match, prefix it with Sh..

# Shell Ruby
v command command
v command 'arg' command 'arg'
v command 'arg1' 'arg2' command 'arg1', 'arg2'
v command -f command :f
v command --flag command :flag
v command --flag-with-dash command :flag_with_dash
v command -f 'foo' command f: 'foo'
v command --flag 'foo' command flag: 'foo'
v command -weird_flag 'foo' command '-weird_flag' => 'foo'

Redirection

Note

When directing to a file, directories for that file's path will be automaticlly create.

# Shell Ruby
v cmd1 | cmd2 cmd1.cmd2
v cmd > file.txt cmd > 'file.txt'
v cmd >> file.txt cmd >> 'file.txt'
cmd | ruby -e '...' (削除) cmd { ... } (削除ここまで)
If the shell-command's name dosen't match with any command existing commands, it can be write like the following: > **Note** If there is match, prefix it with `Sh.`. | # | Shell | Ruby | | - | -------------------------- | -------------------------------- | | v | `command` | `command` | | v | `command 'arg'` | `command 'arg'` | | v | `command 'arg1' 'arg2'` | `command 'arg1', 'arg2'` | | v | `command -f` | `command :f` | | v | `command --flag` | `command :flag` | | v | `command --flag-with-dash` | `command :flag_with_dash` | | v | `command -f 'foo'` | `command f: 'foo'` | | v | `command --flag 'foo'` | `command flag: 'foo'` | | v | `command -weird_flag 'foo'` | `command '-weird_flag' => 'foo'` | ### Redirection > **Note** When directing to a file, directories for that file's path will be automaticlly create. | # | Shell | Ruby | | - | ---------------------- | ------------------- | | v | `cmd1 \| cmd2` | `cmd1.cmd2` | | v | `cmd > file.txt` | `cmd > 'file.txt'` | | v | `cmd >> file.txt` | `cmd >> 'file.txt'` | | | `cmd \| ruby -e '...'` | ~~`cmd { ... }`~~ |
Author
Owner
Copy link
def self.method_missing(*args) = system *args.flatten.map(&:to_s)
```sh def self.method_missing(*args) = system *args.flatten.map(&:to_s) ```
Author
Owner
Copy link

Note

kill, ls are already occupied.

> **Note** `kill`, `ls` are already occupied.
Commenting is not possible because the repository is archived.
No Branch/Tag specified
main
No results found.
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
NNB/shell_on_ruby#1
Reference in a new issue
NNB/shell_on_ruby
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?