Oil is a new Unix shell. It's our upgrade path from bash to a better language and runtime

Related tags

CLI Tools oil
Overview

Oil Source Code

Build Status

Oil is a new Unix shell. It's our upgrade path from bash to a better language and runtime! (Why Create a New Unix Shell? / 2019 FAQ)

It's written in Python, so the code is short and easy to change. But we automatically translate it to C++ with custom tools, to make it fast and small. The deployed executable doesn't depend on Python.

This README is at the root of the git repo.

Contributing

  • Try making the dev build of Oil with the instructions on the Contributing page. This should take 1 to 5 minutes if you have a Linux machine.
  • If it doesn't, let us know. You can post on the #oil-dev channel of oilshell.zulipchat.com, or file an issue on Github.
  • Feel free to grab an issue from Github. Let us know what you're thinking before you get too far.

Quick Start on Linux

After following the instructions on the Contributing page, you'll have a Python program that you can quickly run and change! Try it interactively:

bash$ bin/osh

osh$ name=world
osh$ echo "hello $name"
hello world
  • Try running a shell script you wrote with bin/osh myscript.sh.
  • Try the Oil language with bin/oil.

Let us know if any of these things don't work! The continuous build tests them at every commit.

Dev Build vs. Release Build

Again, note that the developer build is very different from the release tarball. The Contributing page describes this difference in detail.

The release tarballs are linked from the home page. (Developer builds don't work on OS X, so use the release tarballs on OS X.)

Important: We Accept Small Contributions!

Oil is full of many ideas, which may be intimidating at first.

But the bar to contribution is very low. It's basically a medium size Python program with many tests, and many programmers know how to change such programs. It's great for prototyping.

  • For OSH compatibility, I often merge failing spec tests. You don't even have to write code! The tests alone help. I search for related tests with grep xtrace spec/*.test.sh, where xtrace is a shell feature.
  • You only have to make your code work in Python. Plain Python programs are easy to modify. The semi-automated translation to C++ is a separate step, although it often just works.
  • You can influence the design of the Oil language. If you have an itch to scratch, be ambitious. For example, you might want to show us how to implement nonlinear pipelines.

Docs

The Wiki has many developer docs. Feel free to edit them. If you make a major change, let us know on Zulip!

There are also READMEs in some subdirectories, like opy/ and mycpp/.

If you're confused, the best thing to do is to ask on Zulip and someone should produce a pointer and/or improve the docs.

Docs for end users are linked from each release page.

Repository Structure

Try this to show a summary of what's in the repo and their line counts:

$ metrics/source-code.sh overview

(Other functions in this file may be useful as well.)

A Collection of Interpreters

Oil is naturally structured as a set of mutually recursive parsers and evaluators. These interpreters are specified at a high-level: with regular languages, Zephyr ASDL, and a statically-typed subset of Python.

bin/              # Main entry points like bin/osh (source in bin/oil.py)
frontend/         # Lexing/Parsing code common to Oil and OSH
osh/              # OSH parsers and evaluators (cmd, word, sh_expr)
oil_lang/         # Oil parser and evaluator
core/             # Other code shared between Oil and OSH
pylib/            # Borrowed from the Python standard library.
tools/            # User-facing tools, e.g. the osh2oil translator

DSLs / Code Generators

Here are the tools that transform that high-level code to efficient code:

asdl/             # ASDL implementation, derived from CPython
pgen2/            # Parser Generator, borrowed from CPython
mycpp/            # Experimental translator from typed Python to C++.
                  # Depends on MyPy.
opy/              # Python compiler in Python (mycpp/ will replace it)
  lib/            # Common code
  compiler2/      # Bytecode compiler
  byterun/        # Metacircular bytecode VM in Python
  gold/           # tests
  byterun/        # Unused bytecode interpreter

Native Code

We have native code to support both the dev build (running under CPython) and the oil-native build (pure C++):

Python-2.7.13/    # CPython is the initial basis for the Oil VM
native/           # Python extension modules, e.g. libc.c
cpp/              # C++ code which complements the mycpp translation

Several Kinds of Tests

Unit tests are named foo_test.py and live next to foo.py.

test/             # Test automation
  gold/           # Gold Test cases
  gold.sh         
  sh_spec.py      # shell spec test framework
  spec.sh         # Types of test runner: spec, unit, gold, wild
  unit.sh         
  wild.sh
testdata/
spec/             # Spec test cases
  bin/            # tools used in many spec tests
  testdata/       # scripts for specific test cases
  errors/         # TODO: migrate these bad shell scripts
types/            # Scripts for running MyPy and PyAnnotate, etc.

Dev Tools and Scripts

We use a lot of automation to improve the dev process. It's largely written in shell, of course!

benchmarks/       # Benchmarks should be run on multiple machines.
metrics/          # Metrics don't change between machines (e.g. code size)
client/           # Demonstration of OSH as a headless server.
build/            # Build automation
  oil-defs/       # Files that define our slice of CPython.
  dev.sh          # For development builds, running CPython
devtools/         # For Oil developers (not end users)
  release.sh      # The (large) release process.
demo/             # Demonstrations of bash/shell features.  Could be
                  # moved to tests/ if automated.
  old/            # A junk drawer.
web/              # HTML/JS/CSS for tests and tools
soil/             # Multi-cloud continuous build (e.g. sourcehut, Github)
services/         # Other cloud services

Temp Dirs

Directories that begin with _ are not stored in git. The dev tools above create and use these dirs.

_bin/             # Native executables are put here
_build/           # Temporary build files
_devbuild/        # Developer build files not deleted upon 'make clean'
  gen/            # Generated Python and C code
_deps/            # build dependencies like re2c
_tmp/             # Test suites and other temp files
  spec/
  wild/
    raw/
    www/
  osh-parser/
  osh-runtime/
  vm-baseline/
  oheap/
  startup/
  ...
_release/         # Source release tarballs are put here
  VERSION/        # Published at oilshell.org/release/$VERSION/
    benchmarks/
    doc/
    metrics/
    test/
      spec.wwz
      wild.wwz
      ...
    web/          # Static files, copy of $REPO_ROOT/web
      table/

Build System for End Users

This is very different than the developer build of Oil.

Makefile
configure
install

Doc Sources

doc/              # A mix of docs
doctools/         # Tools that use lazylex/ to transform Markdown/HTML
lazylex/          # An HTML lexer which doctools/ builds upon.
README.md         # This page, which is For Oil developers

LICENSE.txt       # For end users
INSTALL.txt

More info

Python Files Not Translated to C++

mycpp/
  mylib.py  # statically typed equivalents of Python's data structures
pylib/      # copied from Python stdlib
core/
  py{error,os,util}.py  # too complicated to translate
*/*_def.py  # abstract definitions
*/*_gen.py  # code generators
Comments
  • security feature: shopt -s no_glob_dash or safer_glob

    security feature: shopt -s no_glob_dash or safer_glob

    From discussion here:

    https://lobste.rs/s/mm99iz/beware_shell_globs

    • If it's no, then a glob that results in an arg that starts with - would be disallowed
    • Although maybe it should be turned off if the glob comes after --? That might be a little too smart? Is it possible that -- is an arg and not a flag? Like
      • mycommand --arg -- *

    Maybe it has to be an unquoted -- to turn it off? So you could do mycommand --arg '--' and that doesn't count?

    • Should it be off by default, but on in oil:basic (and oil:all ?)
    feature carrot strict 
    opened by andychu 37
  • Implement `dirs` builtin

    Implement `dirs` builtin

    Implements the dirs builtin, following the behavior of dirs in bash. This includes using the -c, -v, and -p flags. Two flags have not yet been implemented (-l and -N/+N).

    I've been hit with some other work so I'll tackle the spec tests later. Wanted to get this merged anyway in case it takes me a while to get back to working on this.

    opened by timetoplatypus 33
  • comp_ui.NiceDisplay should take into account unicode character width

    comp_ui.NiceDisplay should take into account unicode character width

    @jyn514 I'm pretty sure this is the issue you just mentioned in #257. There are two separate bugs:

    • If you keep typing past the end of the terminal, OSH has no idea (but zsh and fish do). This is #257.
    • If your prompt contains a unicode character that is say 4 bytes long in utf-8, the code will currently move right FOUR cursor positions instead of ONE. I think that explains the screenshot, since you have a unicode character there.

    I think we can just call the POSIX function wcwidth(), although I guess that involves some conversion to wchar_t, which is annoying:

    http://man7.org/linux/man-pages/man3/wcwidth.3.html

    There is a pure Python version of it, but I'm not sure if we should use it.

    https://pypi.org/project/wcwidth/#files

    interactive-shell 
    opened by andychu 31
  • Set up arguments appropriately before 'source'-ing script

    Set up arguments appropriately before 'source'-ing script

    Fixes #137; addresses part of #116.

    It looks like my builtins test for set -o vi/emacs somehow didn't make it in as part of #120 (??), so that is included as well.

    opened by BatmanAoD 31
  • Run Nix setup.sh?

    Run Nix setup.sh?

    Hm this uses several (ugly) bash features not implemented in Oil:

    We should definitely be able to parse it -- running it will take some work.

    • [x] trap builtin
    • [ ] compatibility issue: case "$(type -t "$hookName")" in fails in OSH because we respect errexit in command sub, but bash doesn't
    • [ ] compatibility issue: for i in "${nativePkgs[@]}"; do -- OSH doesn't allow indexing empty var/string with [@]
    • [x] type builtin (should be easy, only need -t)
    • [x] read flags: -r, -n etc. (but lack of -r not implemented)
    • [x] oldOps="$(shopt -po nounset)"; ...; eval "$oldOpts" (use case for "with" in Oil)
    • [x] setup.sh has same issue as Gentoo in issue #19, trying to run [ with empty $PATH
      • [x] test -x
    • [x] content="${content//"$pattern"/$replacement}"
    • [x] ${FUNCNAME[@]}
    • [x] ${!varRef} -- completion scripts also use this
    • [x] shopt -s nullglob
    • [x] local -a times=(...) (unparsed)
    • [x] declare -a (unparsed)
    • [x] append e.g. eval "$var"'+=("$pkg")' (unparsed)
    • [x] might be tricky: if [[ -z "$makeFlags" && ! ( -n "$makefile" || -e Makefile || -e makefile || -e GNUmakefile[[ ) ]]

    Deferred:

    • [ ] named file descriptors: exec {fd}< "$fn" (unparsed)
    • [ ] closing descriptor: exec {fd}<&- (unparsed)
    • [x] printf builtin -- %q is used, but external command should be OK

    https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L318

    opened by andychu 30
  • single quotes within double quoted brace sub treated differently for the # ## % %% / operators

    single quotes within double quoted brace sub treated differently for the # ## % %% / operators

    Forking from #290.

    $ var=+-
    $ echo "${var//['+-']}"
    Line 16 of '/home/user/.config/oil/oshrc'                                                            
      echo "${var//['+-']}"
                 ^
    fatal: Error matching regex "(['+-'])": Invalid regex syntax (func_regex_first_group_match)
    

    This is indeed a difference between OSH and bash/mksh. It has to do with whether the single quote and hyphen is a SHELL metcharacter or a REGEX metacharacter.

    • Is it a character class containing two characters + and - ?
    • Or does the char class contain a range of characters + through ' ? (which is a regex syntax error)

    @Crestwave can you tell me why you have the single quotes? What are they supposed to do? How is it different than

      echo "${var//[+-]}"
    

    This removes all + and - characters from the string in bash. I can't see what the extra single quotes do?

    I'm not saying this is not a bug -- it's definitely a difference between bash and OSH. But I'm trying to understand the intention behind the code. Thanks.

    high-priority pending-release osh-language divergence 
    opened by andychu 28
  • Run the shellspec test framework

    Run the shellspec test framework

    Hi,

    I am interested in run with ShellSpec.

    ShellSpec is a testing framework for POSIX compliant shell script. One of the notable points is that most features are implemented by pure shell scripts instead of calling external commands.

    It contains tests for ShellSpec itself. Therefore you can check if it works easily.

    cd /shellspec/installed/directory
    shellspec -s /path/to/osh
    

    The currently code size is

    • Total (includes comment and blank): about 7000
    • NLOC (Non-comment Lines of Code): 5000 over
    • LLOC (Logical Lines of Code): 4000 over

    This is reported by ShellMetrics - Cyclomatic Complexity Analyzer. It is also implemented by shell script.

    ShellSpec needs a requires correct implementation of errexit. (ref. #709) (Note: Workarounds have been implemented for some shell flaws.) So when the bosh (Schily Bourne Shell) broke, I could immediately notice it.

    Unfortunately, ShellSpec is for the POSIX shell, so it contains almost no bash syntax. However, you can check if osh is POSIX compliant.

    I'm sorry, but I'm a little busy right now, so I may not be able to help enough. but I think ShellSpec can be used to test run under osh.

    I ran ShellSpec on osh 0.8.pre4 and it showed as below.

      [ ${BASH_VERSION+x} ] &&:
      ^
    [ eval at line 34 of /home/koichi/workspace/shellspec/lib/general.sh ]:34: fatal: Undefined variable
      [ ${ZSH_VERSION+x} ] &&:
      ^
    [ eval at line 34 of /home/koichi/workspace/shellspec/lib/general.sh ]:34: fatal: Undefined variable
      [ ${YASH_VERSION+x} ] &&:
      ^
    [ eval at line 34 of /home/koichi/workspace/shellspec/lib/general.sh ]:34: fatal: Undefined variable
      [ ${POSH_VERSION+x} ] &&:
      ^
    [ eval at line 34 of /home/koichi/workspace/shellspec/lib/general.sh ]:34: fatal: Undefined variable
      [ ${KSH_VERSION+x} ] &&:
      ^
    [ eval at line 34 of /home/koichi/workspace/shellspec/lib/general.sh ]:34: fatal: Undefined variable
          [ -u "$1" ] && chmod 0700 "$1"
          ^
    /home/koichi/workspace/shellspec/lib/libexec/runner.sh:11: fatal: Id.BoolUnary_u isn't implemented
        ( umask 0077; mkdir "$1"
        ^
    /home/koichi/workspace/shellspec/lib/libexec/runner.sh:8: fatal: Exiting with status 1 (subshell invoked from PID 32443)
    

    Regards,

    should-run-this 
    opened by ko1nksm 25
  • Fuzz the parser with AFL

    Fuzz the parser with AFL

    This should help some of the error cases.

    This looks like a good intro:

    https://barro.github.io/2018/01/taking-a-look-at-python-afl/

    I think the steps are:

    • Create a main program like bin/fuzzable_parser.py.
      • Since a parser is basically a pure function, this should use one of the "fast modes".
      • That is, we shouldn't have to fork bin/oil.py every time, which would be really slow
      • Also, by fuzzing only the parser and not the runtime (basically bin/osh -n), then we avoid the problem of the fuzzer making syscalls like fork() and so forth.
    • Write some shell scripts to automate it.

    It would be nice to find a server to do this, but I have at least one at home laying around that could be used.

    help wanted good first issue devtools computer-science 
    opened by andychu 25
  • Improve error message when binary is stripped (Assertion error making OSH AUR package)

    Improve error message when binary is stripped (Assertion error making OSH AUR package)

    Hm this is because the ./configure step writes out the PREFIX to _tmp/detected-config.sh. If the file isn't installed to that place, it won't run.

    The core issue is that a Unix executable doesn't know where it is run from! The executable has to be set as PYTHONPATH in order to find the bytecode.

    https://stackoverflow.com/questions/4031672/without-access-to-argv0-how-do-i-get-the-program-name

    $>   export OVM_VERBOSE=1
    $>   oil.ovm 
    ovm_path = ovm_path_buf (/usr/local/bin/oil.ovm)
    ovm_path: /usr/local/bin/oil.ovm
    # installing zipimport hook
    import zipimport # builtin
    # installed zipimport hook
    oil.ovm: Modules/main.c:347: Ovm_Main: Assertion `sts != -1' failed.
    Aborted (core dumped)
    

    In the PKGBUILD, I do execute ./configure and make to compile OSH. I do not, however, invoke the install script that ships with OSH. This is because the PKGBUILD convention dictates that you shouldn’t rely on an external script to actually do the placement of binaries on the system.

    The PKGBUILD convention prefers that any binaries that need to be installed on the system be placed within a specific subdirectory beneath wherever the PKGBUILD file is sitting (this is referred to as $pkgdir).

    opened by andychu 25
  • Rename oil:basic -> oil:upgrade

    Rename oil:basic -> oil:upgrade

    From @bar-g on #678

    Reason: I think osh:strict oil:basic oil:all has more consistency.

    strict:all was meant to imply the prefix of strict_errexit. However there is no oil_ prefix!

    So the current scheme doesn't make that much sense.

    • I think osh:strict makes more sense because you're taking the OSH language and subsetting it. It still runs under other shells.
    • oil:basic makes sense because you're writing in the basic parts of the Oil language, without breaking things.
    • oil:all is for new scripts. You have everything

    https://github.com/oilshell/oil/wiki/OSH-versus-Oil


    I'm wary of breaking things -- especially since I'm using strict:all myself !!!

    However I think what we can do is:

    1. Make osh:strict an alias for strict:all in the next release. Should be easy.
    2. Change all the docs
    3. Change the wiki.
    4. Maybe even correct the blog
    5. And then like 6 months from now, since we're pre-1.0, just drop strict:all altogether.

    It seems feasible and probably worth it for such a prominent feature

    It's one of the first things you hit when you get started

    pending-release osh-language user-feedback 
    opened by andychu 23
  •  declare -A dict=() not allowed in Oil

    declare -A dict=() not allowed in Oil

    Also what's the difference between declare -A dict and declare -A dict=() in bash?

    There are three different states for variables in Bash. In addition, the "set" state can be categorized into two sub-states:

    1. Not declared (slot is not allocated)
    2. Declared but unset (slot is allocated, but no value is set)
    3. Set (slot is allocated, and a value is set)
      1. Empty
      2. Non-empty

    See the following test case for the behavior differences:

    # test5.sh
    
    function is-declared() { declare -p "$1" &>/dev/null; }
    function is-enumerated-by-declare() { declare | grep -q "^$1="; }
    function is-enumerated-by-varname-expansion() { eval "printf '%s\n' \"\${!$1@}\"" | grep -q "^$1\$"; }
    function is-enumerated-by-compgen () { compgen -v | grep -q "^$1\$"; }
    function is-enumerated-by-compgen-arrayvar () { compgen -A arrayvar | grep -q "^$1\$"; }
    function show-status {
      local -a msg=(yes)
      local f
      for f in $(compgen -A function -- is-); do
        "$f" "$1"
        echo "$f: ${msg[$?]:-no}"
      done
    }
    
    echo "[undeclared]"
    show-status dict
    echo "[declared]"
    declare -A dict
    show-status dict
    echo "[set]"
    dict=()
    show-status dict
    
    $ bash test5.sh
    [undeclared]
    is-declared: no
    is-enumerated-by-compgen: no
    is-enumerated-by-compgen-arrayvar: no
    is-enumerated-by-declare: no
    is-enumerated-by-varname-expansion: no
    [declared]
    is-declared: yes
    is-enumerated-by-compgen: no
    is-enumerated-by-compgen-arrayvar: no
    is-enumerated-by-declare: no
    is-enumerated-by-varname-expansion: no
    [set]
    is-declared: yes
    is-enumerated-by-compgen: yes
    is-enumerated-by-compgen-arrayvar: yes
    is-enumerated-by-declare: yes
    is-enumerated-by-varname-expansion: yes
    

    Related to this, in the help-bash mailing list, I have heard about some script library that gives a default array content when the definition is not given by the application. I'm not sure if it is a good design, but in that library, the empty array is one of the possible configurations, so one needs to distinguish the unset state (declare -A dict) from the empty state (declare -A dict=()). Also, if the array is associative, the library wants to declare the associative array attribute in advance. Such a script can be achieved in the following way:

    # library
    declare -A dict
    is-array-set() { compgen -A arrayvar -X "!$1" -- "$1" &>/dev/null; }
    
    function initialize-lib {
      if ! is-array-set dict; then
        # default dictionary
        dict=([left]=right [up]=down)
      fi
    }
    
    
    # application
    
    # ... set up dict here ...
    
    initialize-lib
    

    Originally posted by @akinomyoga in https://github.com/oilshell/oil/issues/653#issuecomment-599193601

    pending-release 
    opened by andychu 21
  • arithmetic context parsing in for loop issue

    arithmetic context parsing in for loop issue

    consider the following script:

    for (( n=0; n<(3-(1)); n++ )) ; do echo $n; done
    

    which, with bash, runs to completion and produces the following output:

    0
    1
    

    osh fails to correctly parse (or execute this) statement:

    [user@localhost:~]$ osh --version
    Oil version 0.12.9
    Release Date: 2022-11-10 16:36:00+00:00
    Arch: x86_64
    OS: Linux
    Platform: #1-NixOS SMP Wed Dec 21 16:36:38 UTC 2022
    Compiler: GCC 11.3.0
    Interpreter: OVM
    Interpreter version: 2.7.13
    Bytecode: bytecode-opy.zip
    [user@localhost:~]$ osh bug.sh
      for (( n=0; n<(3-(1)); n++ )) ; do echo $n; done
                       ^
    'bug.sh':1: Unexpected left paren (might need a space before it)
    

    correcting that issue, osh -n now succeeds; but running the script, we get a new error:

    [user@localhost:~]$ osh bug.sh
      for (( n=0; n<(3- (1)); n++ )) ; do echo $n; done
                        ^
    'bug.sh':1: fatal: Unexpected typed args passed to external command '3-'
      for (( n=0; n<(3- (1)); n++ )) ; do echo $n; done
                  ^
    'bug.sh':1: fatal: Invalid integer constant 'n/dev/fd/3'
    

    it looks like osh is still failing to parse the arithmetic context and doing a file redirection. if we add different whitespace, we can get it working:

    --- a/bug.sh
    +++ b/bug.sh
    @@ -1 +1 @@
    -for (( n=0; n<(3-(1)); n++ )) ; do echo $n; done
    +for (( n=0; n< (3-(1)); n++ )) ; do echo $n; done
    

    note, this appears present at least as far back as 0.8.12, but with a different error code:

    [user@localhost:~]$ osh --version
    Oil version 0.8.12
    Release Date: 2021-07-06 06:38:25+00:00
    Arch: x86_64
    OS: Linux
    Platform: #1-NixOS SMP Wed Dec 21 16:36:38 UTC 2022
    Compiler: GCC 11.3.0
    Interpreter: OVM
    Interpreter version: 2.7.13
    Bytecode: bytecode-opy.zip
    [user@localhost:~]$ osh bug.sh
      for (( n=0; n<(3-(1)); n++ )) ; do echo $n; done
                        ^
    bug.sh:1: Expected ) in function definition
    

    also, this trivial example is a distillation of AAXtoMP3, and was discovered during nixos/nixpkgs#209620:

    [user@localhost:~]$ curl -OL https://raw.githubusercontent.com/KrumpetPirate/AAXtoMP3/v1.3/AAXtoMP3
    [user@localhost:~]$ nix shell nixpkgs#osh -- -n AAXtoMP3
        for (( n=0; n<(20-(percentage/5)); n++ )) ; do progressbar="$progressbar "; done
                          ^
    AAXtoMP3:204: Unexpected left paren (might need a space before it)
    

    as expected, we can apply the fix that we discovered above, but this still seems like a bash compatibility bug:

    diff --git a/AAXtoMP3 b/AAXtoMP3
    index 90566ad..71e94da 100755
    --- a/AAXtoMP3
    +++ b/AAXtoMP3
    @@ -200,8 +200,8 @@ progressbar() {
    
       #draw progressbar with one # for every 5% and blank spaces for the missing part.
       progressbar=""
    -  for (( n=0; n<(percentage/5); n++ )) ; do progressbar="$progressbar#"; done
    -  for (( n=0; n<(20-(percentage/5)); n++ )) ; do progressbar="$progressbar "; done
    +  for (( n=0; n< (percentage/5); n++ )) ; do progressbar="$progressbar#"; done
    +  for (( n=0; n< (20-(percentage/5)); n++ )) ; do progressbar="$progressbar "; done
    
       #print progressbar
       echo -ne "Chapter splitting: |$progressbar| $print_percentage% ($part/$total chapters)\r"
    
    bug divergence 
    opened by urandom2 1
  • Lazy sweep, not just lazy free()

    Lazy sweep, not just lazy free()

    This gives the "proper" big-O improvement to O(num live objects), not just O(num allocated objects)

    https://oilshell.zulipchat.com/#narrow/stream/121539-oil-dev/topic/TODO.20on.20core.20GC/near/319627427

    And note lazy free() was actually pretty significant on the benchmarks

    help wanted garbage-collection 
    opened by andychu 0
  • FR: list dependencies of a shell script

    FR: list dependencies of a shell script

    Say I'm writing some scripts to bootstrap my OS. I may need to know what this shell script depends on(what environment variables are used, what binaries are expected on path, etc. I think this should be possible to implement as a plugin, but at least we need to have API to make it possible.

    opened by glyh 1
  • more stdlib shell functions: $NEWLINE, $TAB, log, die

    more stdlib shell functions: $NEWLINE, $TAB, log, die

    • Should only be in Oil mode ? Because therwise they will cause incompatibility
    • Probably want to write these as shell, not in Python/C++
      • #750

    See thread on #oil-help about "$NEWLINE$message$NEWLINE"

    https://oilshell.zulipchat.com/#narrow/stream/264891-oil-help/topic/Surround.20string.20with.20.5Cn

    stdlib 
    opened by andychu 0
  • Implement C strings and shopt -s parse_simple_strings, which makes Oil consistent with data languages

    Implement C strings and shopt -s parse_simple_strings, which makes Oil consistent with data languages

    https://oilshell.zulipchat.com/#narrow/stream/325160-oil-discuss-public/topic/Oil.20Changes.20to.20support.20String.2FData.20language.20Unification

    • add \{var} interpolation to $''
    • possibly add $"" as a JSON parser, for generating shell code from other languages?
      • then [$"foo", $"bar\n"] becomes a valid ARGV array I guess
      • differences from "": the characters $ and backtick are no longer special
      • possibly add '{var}` as well, for consistency
    • ~~double quoted strings can support C-escapes like \x00 and \u{1234}, as long as strict_backslash~~
    • ~~add $"" as a synonym to "", which also makes it consistent with $''~~ - NO, maintain this assymetry on purpose
    oil-language maybe-new-syntax data-languages syntax-change 
    opened by andychu 2
adds flavor of interactive filtering to the traditional pipe concept of UNIX shell

percol __ ____ ___ ______________ / / / __ \/ _ \/ ___/ ___/ __ \/ / / /_/ / __/ / / /__/ /_/ / / / .__

Masafumi Oyamada 3.2k Jan 7, 2023
(BionicLambda Universal SHell) A simple shell made in Python. Docs and possible C port incoming.

blush ?? (BionicLambda Universal SHell) A simple shell made in Python. Docs and possible C port incoming. Note: The Linux executables were made on Ubu

null 3 Jun 30, 2021
ICMP Reverse Shell written in Python 3 and with Scapy (backdoor/rev shell)

icmpdoor - ICMP Reverse Shell icmpdoor is an ICMP rev shell written in Python3 and scapy. Tested on Ubuntu 20.04, Debian 10 (Kali Linux), and Windows

Jeroen van Kessel 206 Dec 29, 2022
Kubernetes shell: An integrated shell for working with the Kubernetes

kube-shell Kube-shell: An integrated shell for working with the Kubernetes CLI Under the hood kube-shell still calls kubectl. Kube-shell aims to provi

CloudNative Labs 2.2k Jan 8, 2023
Bear-Shell is a shell based in the terminal or command prompt.

Bear-Shell is a shell based in the terminal or command prompt. You can navigate files, run python files, create files via the BearUtils text editor, and a lot more coming up!

MichaelBear 6 Dec 25, 2021
Bear-Shell is a shell based in the terminal or command prompt.

Bear-Shell is a shell based in the terminal or command prompt. You can navigate files, run python files, create files via the BearUtils text editor, and a lot more coming up!

MichaelBear 6 Dec 25, 2021
iTerm2 Shell integration for Xonsh shell.

iTerm2 Shell Integration iTerm2 Shell integration for Xonsh shell. Installation To install use pip: xpip install xontrib-iterm2 # or: xpip install -U

Noorhteen Raja NJ 6 Dec 29, 2022
Customisable pharmacokinetic model accessible via bash CLI allowing for variable dose calculations as well as intravenous and subcutaneous administration calculations

Pharmacokinetic Modelling Group Project A PharmacoKinetic (PK) modelling function for analysis of injected solute dynamics over time, developed by Gro

null 1 Oct 24, 2021
Alacritty terminal used with Bash, Tmux, Vim, Mutt, Lynx, etc. and the many different additions added to each configuration file

Alacritty terminal used with Bash, Tmux, Vim, Mutt, Lynx, etc. and the many different additions added to each configuration file

Carter 19 Aug 24, 2022
topalias - Linux alias generator from bash/zsh command history with statistics, written on Python.

topalias topalias - Linux alias generator from bash/zsh command history with statistics, written on Python. Features Generate short alias for popular

Sergey Chudakov 38 May 26, 2022
Yet another bash/zsh prompt script

Here we have yet another script for Git-aware customization of the command prompt in Bash and zsh. Unlike all the other scripts, I wrote this one, so

John T. Wodder II 5 Oct 13, 2021
ServX | Bash Command as a Service

ServX | Bash Command as a Service Screenshots Instructions for running Run python3 servx.py. COMPATIBILITY TESTED ON ARCHLINUX(x64) & DEBIAN(x64) ONLY

ARPSyndicate 2 Mar 11, 2022
Automaton - python script to execute bash command based on changes in size of a file.

automaton python script to execute given command <= everytime size of a given file changes,hence everytime a file is modified.(almost) download automa

asrar bhat 1 Jan 3, 2022
A CLI Spigot plugin manager that adheres to Unix conventions and Python best practices.

Spud A cross-platform, Spigot plugin manager that adheres to the Unix philosophy and Python best practices. Some focuses of the project are: Easy and

Tommy Dougiamas 9 Dec 2, 2022
gcptree - Like the unix tree command but for GCP Org Heirarchy

gcptree Like the unix tree command but for GCP Org Heirarchy. For a note on coloring, the org node is green, folders and blue, and projects that are n

Ryan Canty 25 Sep 6, 2022
WebApp Maker make web apps (Duh). It is open source and make with python and shell.

WebApp Maker make web apps (Duh). It is open source and make with python and shell. This app can take any website and turn it into an app. I highly recommend turning these few websites into webapps: - Krunker.io (Fps Game) - play.fancade.com (Minigame Arcade) - Your Own Website If You Have One Apart from that enjoy my app By 220735540 (a.k.a RP400)

null 2 Jan 9, 2022
Standalone script written in Python 3 for generating Reverse Shell one liner snippets and handles the communication between target and client using custom Netcat binaries

Standalone script written in Python 3 for generating Reverse Shell one liner snippets and handles the communication between target and client using custom Netcat binaries. It automates the boring stuff like URL encoding the command and setting up a listener.

Yash Bhardwaj 3 Sep 27, 2022
A CLI/Shell supporting OpenRobot API and more!

A CLI/Shell supporting JeyyAPI, OpenRobot API and RePI API.

OpenRobot Packages 1 Jan 6, 2022
DShell, a tool that combines with discord.py and Jishaku to present to you, shell channels.

Discord shell or dshell for short is a Python package that combines with discord.py and Jishaku to transform an ordinary Discord channel into one capable of running bash commands using a Discord bot.

null 11 Nov 15, 2022