oilshell / oil Goto Github PK
View Code? Open in Web Editor NEWOils is our upgrade path from bash to a better language and runtime. It's also for Python and JavaScript users who avoid shell!
Home Page: http://www.oilshell.org/
License: Other
Oils is our upgrade path from bash to a better language and runtime. It's also for Python and JavaScript users who avoid shell!
Home Page: http://www.oilshell.org/
License: Other
I attempted to try and create an Arch Linux PKGBUILD for this project and realized that setup.py install only installs python libc, and not oil. Could this be fixed?
If you use the test compound command with arithmetic binary operators, there is also a whole let expression available. In bash you can write stuff like:
[[ ('(x=5, y[10]+=5), x*=y[10]' -eq x) && y[2]==y[10]?1:0 -eq 0 ]];
s=$? declare -p s x y;
osh gives me an AssertionError then.
This is because all the Python source is in the app bundle already. Hm.
~/src/oil-0.1.0$ make clean
build/actions.sh clean
find: ‘Python-2.7.13/Lib’: No such file or directory
Makefile:89: recipe for target 'clean' failed
make: *** [clean] Error 1
To be specific, it's in build/quick_ref.py
, #!/usr/bin/env python
should be #!/usr/bin/env python2
This change may be needed on other files, as you wish.
Also, on a related note, when running build/dev.sh minimal
, libc.so
is linked to _devbuild/py-ext/x86_64/libc.so
but the generated file is _devbuild/py-ext/x86_64/libc.cpython-35m-x86_64-linux-gnu.so
. Thus raise an Import Error in native/libc_test.py
when doing import libc
.
And....on a still related note, when I get the correct libc.so import, I'm getting:
native/libc.c:287:3: warning: implicit declaration of function ‘Py_InitModule’ [-Wimplicit-function-declaration]
Py_InitModule("libc", methods);
^
I'm investigating, maybe it would be useful to setup a Travis to show the working chain.
Fixed with 8da6ccb
@lheckemann I just created a dummy issue to talk about this since the pull request was closed.
If you haven't used it yet, the -n
flag is very useful. It prints out the AST/LST. Roughly speaking, there are nodes like (CommandList ...)
and (BracedVarSub ...)
.
But I put some abbreviations like (C ...)
for SimpleCommand and { }
for CompoundWord so it's not too verbose. And ( )
for a word part.
Prior to my fix, there was an empty arg_word:()
, but now it looks like arg_word:(SQ )
-- an empty SingleQuotedPart.
$ bin/osh -n -c 'echo ${empty:-}'
(CommandList
children: [
(C {(echo)}
{
(BracedVarSub
token: <VSub_Name empty>
suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(SQ )})
spids: [2 5]
)
}
)
]
)
Oh and the "spids" mentioned in the comments are "span IDs". I have very detailed source location information for good error messages. But those synthetic nodes have no locations now so it's possible it breaks something.
While exploring the code, I couldn't help but notice that the code style is not pep8 compliant. Following the standard way of writing code is very advantageous as it allow for gentle learning curve for someone how wants to contribute to the project.
make
, because of dep crawlingmentioned in issue #35
icenowy@x220i [ oil@master ] $ bin/osh
osh$ $a
Traceback (most recent call last):
File "bin/osh", line 374, in <module>
sys.exit(main(sys.argv))
File "bin/osh", line 364, in main
return OshMain(main_argv)
File "bin/osh", line 274, in OshMain
InteractiveLoop(opts, ex, c_parser, w_parser, line_reader)
File "bin/osh", line 100, in InteractiveLoop
status, cflow = ex.ExecuteTop(node)
File "/home/icenowy/git-repos/oil/bin/../core/cmd_exec.py", line 635, in ExecuteTop
status, cflow = self.Execute(node)
File "/home/icenowy/git-repos/oil/bin/../core/cmd_exec.py", line 663, in Execute
raise AssertionError('Error evaluating words: %s' % err)
AssertionError: Error evaluating words: ['Undefined variable a', 'Error evaluating word part (SimpleVarSub token:(token id:VSub_Name val:"$a" span_id:0))', 'Error evaluating word (CompoundWord parts:[(SimpleVarSub token:(token id:VSub_Name val:"$a" span_id:0))])']
But on a standard POSIX sh, the value of undefined variables are just nothing.
$ ./_bin/oil.ovm osh
osh$ cd
Traceback (most recent call last):
File "/home/andy/git/oil/Python-2.7.13/Lib/runpy.py", line 174, in _run_module_as_main
File "/home/andy/git/oil/Python-2.7.13/Lib/runpy.py", line 72, in _run_code
File "/home/andy/git/oil/bin/oil.py", line 440, in <module>
File "/home/andy/git/oil/bin/oil.py", line 427, in main
File "/home/andy/git/oil/bin/oil.py", line 410, in OilMain
File "/home/andy/git/oil/bin/oil.py", line 311, in OshMain
File "/home/andy/git/oil/bin/oil.py", line 122, in InteractiveLoop
File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 892, in Execute
File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 856, in _Execute
File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 674, in _Dispatch
File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 885, in _ExecuteList
File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 856, in _Execute
File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 584, in _Dispatch
File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 473, in _RunSimpleCommand
File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 214, in _RunBuiltin
File "/home/andy/git/oil/bin/../core/builtin.py", line 406, in _Cd
IndexError: list index out of range
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.
trap
builtincase "$(type -t "$hookName")" in
fails in OSH because we respect errexit
in command sub, but bash doesn'tfor i in "${nativePkgs[@]}"; do
-- OSH doesn't allow indexing empty var/string with [@]type
builtin (should be easy, only need -t
)read
flags: -r, -n etc. (but lack of -r
not implemented)oldOps="$(shopt -po nounset)"; ...; eval "$oldOpts"
(use case for "with" in Oil)setup.sh
has same issue as Gentoo in issue #19, trying to run [
with empty $PATH
test -x
content="${content//"$pattern"/$replacement}"
${FUNCNAME[@]}
${!varRef}
-- completion scripts also use thisshopt -s nullglob
local -a times=(...)
(unparsed)declare -a
(unparsed)eval "$var"'+=("$pkg")'
(unparsed)if [[ -z "$makeFlags" && ! ( -n "$makefile" || -e Makefile || -e makefile || -e GNUmakefile[[ ) ]]
Deferred:
exec {fd}< "$fn"
(unparsed)exec {fd}<&-
(unparsed)printf
builtin -- %q
is used, but external command should be OKhttps://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L318
Reported here:
Steps:
make SHELL=osh
osh install
This is actually two bugs: typo in install, should be >&
not <&
. And we should implement <&
.
Not sure how relevant this is to oil
, but I figured it was worth pointing out.
This article describes a way to write popen
/system
in terms of clone
+ execve
, which is more efficient than the typical implementation in terms of fork
+ execve
. According to the comments, the posix_spawn
function in glibc
seems to be implemented this way, but apparently has API issues (e.g.: it supposedly doesn't allow you to close all open file handles).
EDIT: this repo is made by the same person, and seems relevant
Reported by timetoplatypus on lobste.rs
Also used in Alpine Linux abuild
scripts
Placeholder for all the issues found
"\n"
escape (within double quotes)[ foo -o bar ]
not parsed correctlyread
builtin should respect IFS (not use Python's split!)k-script-build-static
has fewer lines under OSH.
IFS
issue. "include lines" are parsed with IFS${s%-*}
osh$ ;s
FATAL: failed parse: [ParseError((TokenWord token:(token id:Op_Semi val:";" span_id:0)),)]
The shell quits after this
I use the following bashism to determine if a function I need from a dynamically sourced script is available:
if ! declare -f choose_env > /dev/null; then
echo "Must have choose_env defined"
return 1
fi
However, when I try to run a script that uses this idiom with the 0.3 release, I get the following error:
Unexpected error in execvpe('declare', ['declare', '-f', 'choose_env'], ...): [Errno 2] No such file or directory
It looks like osh doesn't recognize declare as a built-in.
Test case 23 failed non-deterministically with dash for some reason.
The first time it failed, and then subsequent runs worked. Due to tmp file state?
$ test/spec.sh builtins
23 174 FAIL pass pass pass pass set umask in octal
24 185 pass pass pass FAIL FAIL set umask symbolically
107 passed, 5 ok, 3 known unimplemented, 5 known bugs, 3 failed, 0 skipped
Also, there are some bugs related that only show up when you run the whole test suite in parallel.
Test case (extracted from a large shell script used by my employer):
#!/bin/bash
component=foo
foo_tasks=(a b c)
eval tasks=(\${${component}_tasks[@]})
echo "${tasks[@]}"
Result with osh 0.3.0:
Line 4 of 'arrlit.sh'
eval tasks=(\${${component}_tasks[@]})
^~~~~~
Unexpected array literal: (CompoundWord
parts: [
(ArrayLiteralPart
words: [
(CompoundWord
...
Result with bash 4.3.32:
a b c
JFYI...
this would allow python tools that provide toy-ish shell subsets (like tox for example)
to provide a real shell language without implementing an own
Mentioned here and in issue #59
https://www.reddit.com/r/oilshell/comments/7lqbzc/osh_03_optimization_benchmarks_and_bug_fixes/
There are multiple parts to trap
, so it may take multiple steps.
This was reported on the mailing list and also here:
https://lobste.rs/s/obktxo/oil_shell_help_needed_if_you_have_debian/comments/akvbsk#c_akvbsk
sh_spec.py needs to read with a known encoding. *.test.sh should be restricted to utf-8 ?
$ ./spec.sh all
./spec-runner.sh run-cases append
./spec-runner.sh run-cases arith-context
./spec-runner.sh run-cases arith
./spec-runner.sh run-cases array
./spec-runner.sh run-cases assign
./spec-runner.sh run-cases assoc-zsh
./spec-runner.sh run-cases assoc
./spec-runner.sh run-cases blog1
Traceback (most recent call last):
File "./sh_spec.py", line 838, in <module>
sys.exit(main(sys.argv))
File "./sh_spec.py", line 766, in main
tokens = Tokenizer(LineIter(f))
File "./sh_spec.py", line 125, in __init__
self.next()
File "./sh_spec.py", line 129, in next
self.cursor = self.it.__next__()
File "./sh_spec.py", line 87, in LineIter
for i, line in enumerate(f):
File "/usr/lib/python3.4/encodings/ascii.py", line 26, in decode
return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 133: ordinal not in range(128)
./spec-runner.sh run-cases brace-expansion
./spec-runner.sh run-cases bugs
./spec-runner.sh run-cases builtins
./spec-runner.sh run-cases case_
./spec-runner.sh run-cases command-sub
./spec-runner.sh run-cases comments
*** Got 1 allowed osh failures, exit with status 0
./spec-runner.sh run-cases dbracket
Traceback (most recent call last):
File "./sh_spec.py", line 838, in <module>
sys.exit(main(sys.argv))
File "./sh_spec.py", line 766, in main
tokens = Tokenizer(LineIter(f))
File "./sh_spec.py", line 125, in __init__
self.next()
File "./sh_spec.py", line 129, in next
self.cursor = self.it.__next__()
File "./sh_spec.py", line 87, in LineIter
for i, line in enumerate(f):
File "/usr/lib/python3.4/encodings/ascii.py", line 26, in decode
return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 2750: ordinal not in range(128)
./spec-runner.sh run-cases dparen
Since we have [[, [ should be implemented too. Basically every shell has it.
https://www.reddit.com/r/oilshell/comments/6p2tp0/please_try_the_first_osh_release/dkmmzng/
There have been some issues with assuming /usr/bin/time, /usr/bin/python, /bin/bash, etc. This seems to be the first issue everybody runs into when developing Oil.
The tests also depend on gawk I think. And the shells: busybox, dash, bash, ash, etc.
Right now I think the best solution is an Alpine Linux chroot, because it's small and easy to set up. Should be runnable on any distro quite easily.
FYI @lheckemann
Also see issue #12
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).
Most of these are probably because I froze pyconfig.h with Alpine Linux / gcc / musl libc.
SIZEOF_LONG
issue fixed)TODO: Run on faster virtualized armhf box!
Even if readline is correctly detected as absent, app_deps.py
will fail when called by scripts/release.sh oil
to determine oil's dependencies as it tries (and fails) to import readline unconditionally — even if the module wasn't built because the C library was missing.
Right now, when I run bin/osh, ls
works, but cd
either does nothing, or fails because it cannot find the cd executable, depending on if I am running on OSX or Ubuntu 14.04
For backwards compatibility, ancient versions of the pre-bash, pre-POSIX Bourne shell, AKA the OpenSolaris Bourne shell, AKA "osh", is available on Linux systems today. The "osh" name for oilshell conflicts with this legacy shell, and so may confuse text editors and other systems. Would it be possible to select another name for the oilshell binary?
Certain inputs will trigger an uncaught Python exception. If you run into such a bug, report it on Github, or leave a comment.
./_bin/oil.ovm osh
osh$ source asdf
Traceback (most recent call last):
File "/home/andy/git/oil/Python-2.7.13/Lib/runpy.py", line 174, in _run_module_as_main
File "/home/andy/git/oil/Python-2.7.13/Lib/runpy.py", line 72, in _run_code
File "/home/andy/git/oil/bin/oil.py", line 440, in <module>
File "/home/andy/git/oil/bin/oil.py", line 427, in main
File "/home/andy/git/oil/bin/oil.py", line 410, in OilMain
File "/home/andy/git/oil/bin/oil.py", line 311, in OshMain
File "/home/andy/git/oil/bin/oil.py", line 122, in InteractiveLoop
File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 892, in Execute
File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 856, in _Execute
File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 674, in _Dispatch
File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 885, in _ExecuteList
File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 856, in _Execute
File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 584, in _Dispatch
File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 473, in _RunSimpleCommand
File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 244, in _RunBuiltin
File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 177, in _Source
IOError: [Errno 2] No such file or directory: 'asdf'
Is this a Python version issue? Or a kernel issue (I doubt it). For now I disabled two tests:
It might just go away when we properly implement osh.
Installing to /home/poppy/bin/oil.ovm
install: cannot create regular file '/home/poppy/bin/oil.ov
': No such file or directory
FATAL install error: Couldn't install oil binary
A couple of small issues related to distribution and packaging. This would ideally be handled on IRC but it appears oilshell doesn't advertise a channel anywhere I could find.
Currently using the commit a6bc98e
So far this in my experience trying to build this software. I start with ./configure --help
which tells me I can use --with-readline
and it appears to support the --prefix
mechanism.
Running the command ./configure --prefix=/usr --with-readline
simply exits with a return status of 1.
When using sh -x
(since the script defines itself to be /bin/sh
) it seems to show the intended error indicating a failure to detect readline:
+ FLAG_prefix=/usr/local
+ FLAG_with_readline=
+ FLAG_without_readline=
+ true
+ case "$1" in
++ expr --prefix=/usr : '--prefix=\(.*\)'
+ FLAG_prefix=/usr
+ shift
+ true
+ case "$1" in
+ FLAG_with_readline=1
+ shift
+ true
+ case "$1" in
+ break
+ main
+ cc_quiet build/detect-cc.c
+ cc build/detect-cc.c -o /dev/null
+ mkdir -p _build
+ local out=_build/detected-config.sh
+ detect_and_echo_vars
+ test '' = 1
+ detect_readline
+ cc_quiet build/detect-readline.c -l readline
+ cc build/detect-readline.c -l readline -o /dev/null
+ test 1 = 1
+ die 'readline was not detected on the system (--with-readline passed).'
+ echo './configure ERROR: readline was not detected on the system (--with-readline passed).'
+ exit 1
This appears to be due to the detect-readline.c
not including the relevant headers as documented in the manual (at least for readline 7.0):
I wish readline would get a .pc file...
diff --git a/build/detect-readline.c b/build/detect-readline.c
index 4b85e5d..b27ac29 100644
--- a/build/detect-readline.c
+++ b/build/detect-readline.c
@@ -1,4 +1,6 @@
+#include <stdio.h>
#include <readline/readline.h>
+#include <readline/history.h>
int main(void) {
char *line = readline("");
After fixing this the initial ./configure
command seems to succeed with the message:
./configure: Wrote _build/detected-config.sh
However when running make
I am faced with the following issues:
% make
test -d _build/oil && \
build/actions.sh app-deps oil ~/git/oil bin.oil
ln: failed to create symbolic link '/home/earnest/git/oil/_tmp': No such file or directory
test -d _build/hello && \
build/actions.sh app-deps hello build/testdata hello
ln: failed to create symbolic link '/home/earnest/git/oil/_tmp': No such file or directory
make: *** No rule to make target '_build/oil/app-deps-c.txt', needed by '_build/oil/all-deps-c.txt'. Stop.
This is just a simple laundry list of issues which could have been discussed elsewhere but github seemed like the only place.
Reported here:
https://www.reddit.com/r/ProgrammingLanguages/comments/6z730t/please_try_the_osh_01_release/
$ read x y <<< '1\ 2 3 4'
$ echo $x
1 2
$ echo $y
3 4
$ read -r x y <<< '1\ 2 3 4'
$ echo $x
1\
$ echo $y
2 3 4
execvpe()
apparently results in a lot of execve() calls, which other shells don't do. Is this related to caching?
~/git/alpine/abuild$ strace -ff -e fork,execve -- ~/git/oil/bin/osh -c 'ls /'
execve("/home/andy/git/oil/bin/osh", ["/home/andy/git/oil/bin/osh", "-c", "ls /"], [/* 75 vars */]) = 0
execve("/usr/local/sbin/python", ["python", "/home/andy/git/oil/bin/osh", "-c", "ls /"], [/* 75 vars */]) = -1 ENOENT (No such file or directory)
execve("/usr/local/bin/python", ["python", "/home/andy/git/oil/bin/osh", "-c", "ls /"], [/* 75 vars */]) = -1 ENOENT (No such file or directory)
execve("/usr/sbin/python", ["python", "/home/andy/git/oil/bin/osh", "-c", "ls /"], [/* 75 vars */]) = -1 ENOENT (No such file or directory)
execve("/usr/bin/python", ["python", "/home/andy/git/oil/bin/osh", "-c", "ls /"], [/* 75 vars */]) = 0
strace: Process 24347 attached
[pid 24347] execve("/usr/local/sbin/ls", ["ls", "/"], [/* 75 vars */]) = -1 ENOENT (No such file or directory)
[pid 24347] execve("/usr/local/bin/ls", ["ls", "/"], [/* 75 vars */]) = -1 ENOENT (No such file or directory)
[pid 24347] execve("/usr/sbin/ls", ["ls", "/"], [/* 75 vars */]) = -1 ENOENT (No such file or directory)
[pid 24347] execve("/usr/bin/ls", ["ls", "/"], [/* 75 vars */]) = -1 ENOENT (No such file or directory)
[pid 24347] execve("/sbin/ls", ["ls", "/"], [/* 75 vars */]) = -1 ENOENT (No such file or directory)
[pid 24347] execve("/bin/ls", ["ls", "/"], [/* 75 vars */]) = 0
bin cdrom etc initrd.img lib lib64 media opt root sbin srv tmp var vmlinuz.old
boot dev home initrd.img.old lib32 lost+found mnt proc run snap sys usr vmlinuz
vs. dash and bash
~/git/alpine/abuild$ strace -ff -e fork,execve -- bash -c 'ls /'
execve("/bin/bash", ["bash", "-c", "ls /"], [/* 75 vars */]) = 0
execve("/bin/ls", ["ls", "/"], [/* 74 vars */]) = 0
bin cdrom etc initrd.img lib lib64 media opt root sbin srv tmp var vmlinuz.old
boot dev home initrd.img.old lib32 lost+found mnt proc run snap sys usr vmlinuz
Running command -v clear
, for example, yields the following error message in OSH:
Unexpected error in execvpe('command', ['command', '-v', 'clear'], ...): [Errno 2] No such file or directory
$ echo $SHELL
/bin/bash
$ osh
osh$ cat
^C
$ echo $SHELL
/bin/bash
Should be respected when a moduled is source
'd.
https://www.reddit.com/r/oilshell/comments/7c3efm/osh_02_parsing_one_million_lines_of_shell/dq2wifb/
It's so nice to see that somebody finally designs and implements a proper shell! I absolutely must say that you're awesome and your work is great.
But this issue is not about that but some nice feature of rc shell:
<{command}
>{command}
The command is executed asynchronously with its standard output or standard input connected to a pipe. The value of the argument is the name of a file referring to the other end of the pipe. This allows the construction of non-linear pipelines. For example, the following runs two commands old and new and uses cmp to compare their outputs
cmp <{old} <{new}
It works fine when used like foo <{bar} >{baz}
, but when you try to assign <{bar}
or >{baz}
to variables to use later, problems occur. Also, rc provides no way to create a bidirectional stream.
So I wonder, if can shell have CSP-like streams? Like Go channels or Erlang processes. It would be a really nice feature to have, though I haven't figured out how exactly should it look like.
Blocking: need fd stack for opening files. Must be above descriptor 10.
Deboostrap uses a lot of descriptors below 10.
They're a little ugly now, e.g.
$ bin/osh -c 'source bad.sh'
osh error: Parse error in 'bad.sh':
Line 1 of 'bad.sh'
echo >
^
Expected word after redirect operator
---
Line 0 of '<unknown>'
<no position info for token>
Error parsing AndOr in ParseCommandTerm
---
On an AWS EC2 instance running RedHat 7.3 I set up a user and used chsh to change its login shell to OSH. When I try to log in as that user I get the following:
Usage: oil MAIN_NAME [ARG]...
MAIN_NAME [ARG]...
oil behaves like busybox. If it's invoked through a symlink, e.g. 'osh', then
it behaves like that binary. Otherwise the binary name can be passed as the
first argument, e.g.:
oil osh -c 'echo hi'
Invalid main '-osh'
Then the connection is closed.
OSH is installed as /usr/local/bin/oil with a symlink from /usr/local/bin/osh . There is an entry in /etc/shells for /usr/local/bin/osh .
I get the same error if I try sudo -i -u $USER
or su - $USER
.
Any time I pass an argument to the help
builtin, OSH crashes. It's also a bit odd because it explicitly has "/home/andy" in the error message.
$> # I'm in bash here
$> osh --version
Oil version 0.2.0
Release Date: 2017-11-09 05:50:32+00:00
Arch: x86_64
OS: Linux
Platform: #1 SMP PREEMPT Wed Nov 8 11:54:06 CET 2017
Compiler: GCC 7.2.0
Interpreter: OVM
Interpreter version: 2.7.13
$> # Dropping into OSH now
$> osh
$osh> help
Usage:
help <topic> -- show help on a given topic
help toc -- list help topics
help osh-usage -- same as osh --help
help oil-usage -- same as oil --help
View on the web: http://www.oilshell.org/$VERSION/doc/osh-quick-ref.html
$osh> help echo
Traceback (most recent call last):
File "/home/andy/git/oilshell/oil/Python-2.7.13/Lib/runpy.py", line 174, in _run_module_as_main
File "/home/andy/git/oilshell/oil/Python-2.7.13/Lib/runpy.py", line 72, in _run_code
File "/home/andy/git/oilshell/oil/bin/oil.py", line 475, in <module>
File "/home/andy/git/oilshell/oil/bin/oil.py", line 458, in main
File "/home/andy/git/oilshell/oil/bin/oil.py", line 441, in OilMain
File "/home/andy/git/oilshell/oil/bin/oil.py", line 329, in OshMain
File "/home/andy/git/oilshell/oil/bin/oil.py", line 131, in InteractiveLoop
File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 969, in Execute
File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 933, in _Execute
File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 743, in _Dispatch
File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 962, in _ExecuteList
File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 933, in _Execute
File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 623, in _Dispatch
File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 511, in _RunSimpleCommand
File "/home/andy/git/oilshell/oil/bin/../core/cmd_exec.py", line 312, in _RunBuiltin
File "/home/andy/git/oil/bin/../core/builtin.py", line 866, in Help
KeyError: 'echo'
FATAL: couldn't import from app bundle '/home/timetoplatypus/Documents/archBuilds/osh/pkg/osh/usr/bin/oil.ovm' (1)
Stripping the oil.ovm binary may cause this error.
See https://github.com/oilshell/oil/issues/47
$> # OSH has crashed and I'm back in bash here
Given a script foo.sh
which osh cannot parse, source foo.sh
gives much less helpful information than osh foo.sh
, simply outputting the contents of the script rather than describing the errors.
$ cat foo.sh
declare -a foo
$ result/bin/osh -c 'source foo.sh'
Error parsing code 'declare -a foo\n'
$ result/bin/osh foo.sh
Line 1 of 'foo.sh'
declare -a foo
^~
Invalid variable name '-a'
---
Line 0 of '<unknown>'
<no position info for token>
Error parsing AndOr in ParseCommandTerm
---
Right now the contributing doc uses the ssh git URL instead of the https URL. Is this done for any particular reason? I had trouble pulling due to public key permissions, but could pull using the https URL.
The functions one
and smoke
as documented in https://github.com/oilshell/oil/wiki/Contributing and in the comments in test/unit.sh
are missing from that script.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.