mkdir: created directory '_tmp/doc/ysh-tour'
_tmp/doc/ysh-tour -> (doctools/cmark) -> _release/VERSION/doc/ysh-tour.html
~/oil/_tmp/ysh-tour ~/oil
hello world
one
two
hello world
hello world
90
positive
[0] item 90
[1] item 7
/tmp
/home/uke/oil/_tmp/ysh-tour
{
"name": "bob",
"age": 42
}
(List) ['str', 42]
hi
hi alice, bye
$ " \
c:\Program Files\
A is A
line two, with backslash \
byte ÿ
command sub: hi
expression sub: 93
var sub: 90
$1.99
$2.00 # literal $, no interpolation
A B
C D
ale
_ale_
_ ale _
default
92210b4ab310
_ 92210b4ab310 _
ale
7
_ 7 _
bar.py
demo.py
foo.py
alice@example.com
bob@example.com
S
ale
bean
E
ale
bean
1
2
3
hello world
hello alice
total 64
-rw-r--r-- 1 uke uke 6 Dec 7 11:26 3.txt
drwxr-xr-x 3 uke uke 4096 Dec 7 11:22 eggs
-rw-r--r-- 1 uke uke 3 Dec 7 11:26 greeting.txt
-rwxr-xr-x 1 uke uke 0 Dec 7 11:23 grep
-rwxr-xr-x 1 uke uke 0 Dec 7 11:23 mv
drwxr-xr-x 4 uke uke 4096 Dec 7 11:22 oil-spec-test
drwxr-xr-x 3 uke uke 4096 Dec 7 11:22 oil_test
drwxr-xr-x 2 uke uke 4096 Dec 7 11:22 oil_tests
drwxr-xr-x 3 uke uke 4096 Dec 7 11:22 oils-spec
drwxr-xr-x 3 uke uke 4096 Dec 7 11:22 osh-spec-cd
-rw-r--r-- 1 uke uke 3 Dec 7 11:20 redir.txt
-rw-r--r-- 1 uke uke 3 Dec 7 11:20 sentence.txt
drwxr-xr-x 3 uke uke 4096 Dec 7 11:22 spam
-rw-r--r-- 1 uke uke 0 Dec 7 11:20 stderr.txt
-rwxr-xr-x 1 uke uke 0 Dec 7 11:23 tar
drwx------ 2 uke uke 4096 Dec 7 11:19 tmp.WNEgiysWPl
drwx------ 2 uke uke 4096 Dec 7 11:18 tmp.bEX1pD2alo
drwx------ 2 uke uke 4096 Dec 7 11:18 tmp.jgUqKLuuXJ
drwx------ 2 uke uke 4096 Dec 7 11:26 tmp.zUy1IBODOd
drwx------ 2 uke uke 4096 Dec 7 11:26 tmp.zcTUuvqYs9
90
hi
3.txt
eggs
greeting.txt
grep
mv
oil-spec-test
oil_test
oil_tests
oils-spec
osh-spec-cd
redir.txt
sentence.txt
spam
stderr.txt
tar
tmp.WNEgiysWPl
tmp.bEX1pD2alo
tmp.jgUqKLuuXJ
tmp.zUy1IBODOd
tmp.zcTUuvqYs9
fatal error
3.txt
eggs
greeting.txt
grep
mv
oil-spec-test
oil_test
oil_tests
oils-spec
osh-spec-cd
redir.txt
sentence.txt
spam
stderr.txt
tar
tmp.WNEgiysWPl
tmp.bEX1pD2alo
tmp.jgUqKLuuXJ
tmp.zUy1IBODOd
tmp.zcTUuvqYs9
hi
hi
hi
.
11
0
alice
oils
13
peanut
coconut
0 - README.md
1 - bar.py
2 - demo.py
3 - foo.py
i = 3
i = 4
ale
bean
pea
nut
pea 42
nut 10
0 pea 42
1 nut 10
i = 3
i = 4
i = 5
neither
alice is not a user
so many beans
we aren't done
Other
Markdown
cp: cannot stat 'foo': No such file or directory
error copying
myproc
^~~~~~
tour.ysh:374: Command 'myproc' not found (OILS-ERR-100)
failed
crw-rw-rw- 1 nobody nogroup 1, 3 Dec 7 11:16 /dev/null
-rw-r--r-- 1 root root 874 Nov 2 17:27 /etc/passwd
'log.txt' -> '/tmp/log.txt'
3.txt
eggs
greeting.txt
grep
log.txt
mv
oil-spec-test
oil_test
oil_tests
oils-spec
osh-spec-cd
redir.txt
sentence.txt
spam
stderr.txt
tar
tmp.WNEgiysWPl
tmp.bEX1pD2alo
tmp.jgUqKLuuXJ
tmp.zUy1IBODOd
tmp.zcTUuvqYs9
{
"name": "alice",
"age": 42
}
/tmp
(List) [1, 2]
cp: cannot stat 'ale': No such file or directory
cp: cannot stat 'bean': No such file or directory
x = 42
zzz
zzz !!
ale
yes
42 65536
65536 493 21
corn
bean
ale
ZZZ
name is alice
0
myMethod
null
mutatingMethod
who=uke
enough
equal after stripping whitespace and type conversion
Python
not shell
43
ale bean 43
doesn't end with .255
hello
world
43
ale BEAN
hello 🙂
(Dict) {x: 42}
proc1
p2
p3
Copying source files
'bar.py' -> '/tmp/ysh-tour/bar.py'
'demo.py' -> '/tmp/ysh-tour/demo.py'
'foo.py' -> '/tmp/ysh-tour/foo.py'
'build.sh' -> '/tmp/ysh-tour/build.sh'
'test.sh' -> '/tmp/ysh-tour/test.sh'
~/oil
mkdir: created directory '_tmp/doc/ysh-io'
_tmp/doc/ysh-io -> (doctools/cmark) -> _release/VERSION/doc/ysh-io.html
~/oil/_tmp/ysh-io ~/oil
> pipeline
| part 45109
. builtin read --all
. 45109 exec hostname
; process 45109: status 0
< pipeline
. builtin write -- $'92210b4ab310\n'
92210b4ab310
. builtin echo $'92210b4ab310\n'
92210b4ab310
| command 45110: mkdir -p mydir
; process 45110: status 0
| command 45111: touch 'mydir/file with spaces'
; process 45111: status 0
| command 45112: touch $'mydir/newline \n file'
; process 45112: status 0
| command 45113: find .
; process 45113: status 0
| command 45114: find . -print0
; process 45114: status 0
. builtin redir
. builtin write -- '"mydir/file with spaces"'
. builtin write -- $'"mydir/newline \\n file"'
| command 45115: head lines.txt j8-lines.txt
==> lines.txt <==
.
./lines.txt
./ref
./ysh-io.ysh
./mydir
./mydir/newline
file
./mydir/file with spaces
==> j8-lines.txt <==
"mydir/file with spaces"
"mydir/newline \n file"
; process 45115: status 0
> pipeline
| part 45116
. builtin read --all
| 45116 fork 45117
. 45117 builtin cat lines.txt
; 45116 process 45117: status 0
; process 45116: status 0
< pipeline
(Str)
b'.\n./lines.txt\n./ref\n./ysh-io.ysh\n./mydir\n./mydir/newline \n file\n./mydir/file with spaces\n'
. builtin write --end '' -- $'.\n./lines.txt\n./ref\n./ysh-io.ysh\n./mydir\n./mydir/newline \n file\n./mydir/file with spaces\n'
| command 45118: diff lines.txt out.txt
; process 45118: status 0
> pipeline
| part 45119
| 45119 fork 45120
. 45120 builtin cat lines.txt
; 45119 process 45120: status 0
; process 45119: status 0
< pipeline
(List)
[
'.',
'./lines.txt',
'./ref',
'./ysh-io.ysh',
'./mydir',
'./mydir/newline ',
' file',
'./mydir/file with spaces'
]
. builtin write -- . ./lines.txt ./ref ./ysh-io.ysh ./mydir './mydir/newline ' ' file' './mydir/file with spaces'
| command 45121: diff lines.txt out.txt
; process 45121: status 0
> pipeline
| part 45122
. builtin read --raw-line
| 45122 fork 45123
. 45123 builtin cat lines.txt
. builtin read --raw-line
; 45122 process 45123: status 0
. builtin read --raw-line
. builtin read --raw-line
. builtin read --raw-line
. builtin read --raw-line
. builtin read --raw-line
. builtin read --raw-line
. builtin read --raw-line
; process 45122: status 0
< pipeline
(List)
[
'.',
'./lines.txt',
'./ref',
'./ysh-io.ysh',
'./mydir',
'./mydir/newline ',
' file',
'./mydir/file with spaces'
]
. builtin write -- . ./lines.txt ./ref ./ysh-io.ysh ./mydir './mydir/newline ' ' file' './mydir/file with spaces'
| command 45124: diff lines.txt out.txt
; process 45124: status 0
. builtin read --all
(List)
[
'.',
'./lines.txt',
'./ref',
'./ysh-io.ysh',
'./0.bin',
'./mydir',
b'./mydir/newline \n file',
'./mydir/file with spaces'
]
. builtin write --sep $'\u0000' --end $'\u0000' -- . ./lines.txt ./ref ./ysh-io.ysh ./0.bin ./mydir $'./mydir/newline \n file' './mydir/file with spaces'
| command 45125: diff 0.bin out0.bin
; process 45125: status 0
> pipeline
| part 45126
. builtin read -0 path
| 45126 fork 45127
. 45127 builtin cat 0.bin
. builtin read -0 path
; 45126 process 45127: status 0
. builtin read -0 path
. builtin read -0 path
. builtin read -0 path
. builtin read -0 path
. builtin read -0 path
. builtin read -0 path
. builtin read -0 path
; process 45126: status 0
< pipeline
(List)
[
'.',
'./lines.txt',
'./ref',
'./ysh-io.ysh',
'./0.bin',
'./mydir',
b'./mydir/newline \n file',
'./mydir/file with spaces'
]
. builtin write --sep $'\u0000' --end $'\u0000' -- . ./lines.txt ./ref ./ysh-io.ysh ./0.bin ./mydir $'./mydir/newline \n file' './mydir/file with spaces'
| command 45128: diff 0.bin out0.bin
; process 45128: status 0
| command sub 45129
| 45129 fork 45130
. 45130 builtin cat j8-lines.txt
; 45129 process 45130: status 0
; process 45129: status 0
(List) ['mydir/file with spaces', b'mydir/newline \n file']
. builtin redir
. builtin write -- '"mydir/file with spaces"'
. builtin write -- $'"mydir/newline \\n file"'
| command 45131: diff j8-lines.txt j8-out.txt
; process 45131: status 0
. builtin redir
. builtin write -- '"with space"'
. builtin write -- $'"with \\n newline"'
| fork 45132
. 45132 builtin cat j8-tmp.txt
"with space"
"with \n newline"
; process 45132: status 0
. builtin assert
| command sub 45133
| 45133 fork 45134
. 45134 builtin cat j8-tmp.txt
; 45133 process 45134: status 0
; process 45133: status 0
~/oil
Warning: Couldn't import pygments, so skipping syntax highlighting
Warning: Couldn't import pygments, so skipping syntax highlighting
Warning: Couldn't import pygments, so skipping syntax highlighting
Warning: Couldn't import pygments, so skipping syntax highlighting
Warning: Couldn't import pygments, so skipping syntax highlighting
Warning: Couldn't import pygments, so skipping syntax highlighting
Warning: Couldn't import pygments, so skipping syntax highlighting
_tmp/doc/ref/chap-type-method -> (doctools/cmark) -> _release/VERSION/doc/ref/chap-type-method.html
~/oil/_tmp/ref/chap-type-method ~/oil
(Null) null
(Bool) true
(Bool) false
(Str) 'mystr'
(Str) 'mystr'
(Str) 'Year: 1989, Month: 06, Day: 08'
(Str) '1990-06-08'
(Str) 'replace with mystr.replace()'
(Str) 'replace and zz with and zz mystr and zz.replace and zz()'
(Str) 'Bob has a friend named bob'
(Str) 'Bob has a friend named Bob'
(Bool) true
(Bool) false
(Bool) true
(Bool) false
(Str) 'Σ'
(Bool) true
(Bool) true
(Bool) true
(Bool) true
(Str) 'YSH'
(Str) 'YSH '
(Str) ' YSH'
(Str) ' YSH '
(Str) 'YSH'
(Str) 'YSH'
(Str) b'YSH\n'
(Str) 'YSHxxx'
(Str) 'YSH456'
(Str) ' YSH'
(Str) 'xxxYSH'
(Str) '123YSH'
(Int) 1
(Null) null
(Int) 4
(Null) null
(Int) 0
(Null) null
(Int) 1
(Null) null
. builtin pp
pp ('a;b;;c'.split(';')) # => ["a", "b", "", "c"]
^
ref/chap-type-method.ysh:110: (List) ['a', 'b', '', 'c']
. builtin pp
pp ('a<>b<>c')) # => ["a", "b", "c ["🌞", "🌞", "🌞"]
^
ref/chap-type-method.ysh:112: (List) ['🌞', '🌞', '🌞']
. builtin pp
pp ('a b cd'.split(/ space+ /)) # => ["a", "b", "cd"]
^
ref/chap-type-method.ysh:115: (List) ['a', 'b', 'cd']
. builtin pp
pp ('a,b;c'.split(/ ',' | ';' /)) # => ["a", "b", "c"]
^
ref/chap-type-method.ysh:116: (List) ['a', 'b', 'c']
. builtin pp
pp ('a;b;;c'.split(';', count=2)) # => ["a", "b", ";c"]
^
ref/chap-type-method.ysh:119: (List) ['a', 'b', ';c']
. builtin pp
pp ('a;b;;c'.split(';', count=-1)) # => ["a", "b", "", "c"]
^
ref/chap-type-method.ysh:120: (List) ['a', 'b', '', 'c']
(List) ['foo', 'bar']
(List) ['foo', 'bar']
. builtin echo ':59'
:59
. builtin echo 59
59
. builtin echo 59
59
. builtin echo 2
2
. builtin echo 3
3
. builtin echo 3
3
. builtin echo 5
5
. builtin echo 5
5
. builtin echo 5
5
. builtin echo apple banana pear orange
apple banana pear orange
. builtin echo orange
orange
. builtin echo apple banana pear
apple banana pear
. builtin echo cheese chocolate apple banana
cheese chocolate apple banana
. builtin echo 3
3
. builtin echo -1
-1
. builtin echo pillar raise glaramara helvellyn
pillar raise glaramara helvellyn
. builtin echo 3
3
. builtin echo -1
-1
. builtin echo coniston derwent
coniston derwent
. builtin echo pear banana apple
pear banana apple
. builtin echo 0
0
(Dict) {title: 'The Histories', author: 'Herodotus'}
(Dict) {title: 'The Histories'}
(Dict) {title: 'The Histories'}
(Dict) {a: [1]}
(Dict) {a: [1, 2]}
(Dict) {a: [1, 2, 'b']}
(Dict) {a: [1, 2, 'b'], b: [1]}
(Dict) {a: [1, 2, 'b'], b: [1], c: [[1, 2]]}
(Dict) {a: 1, b: 3.14}
(Dict) {a: 3, b: 3.14}
(Dict) {a: 3, b: 5.28}
call mydict->add('a')
^
ref/chap-type-method.ysh:259: fatal: Expected at least 3 typed args, but only got 2