2021-08-14 20:50:17 +03:00
|
|
|
|
$ fq -i
|
2021-09-27 23:42:34 +03:00
|
|
|
|
null>
|
2021-09-23 15:39:03 +03:00
|
|
|
|
null> .
|
|
|
|
|
null
|
2021-08-14 20:50:17 +03:00
|
|
|
|
null> 1+1
|
|
|
|
|
2
|
2022-03-03 23:23:31 +03:00
|
|
|
|
null> repl({color: true})
|
|
|
|
|
[90m>[39m [37mnull[39m> )
|
|
|
|
|
^ unexpected token ")"
|
|
|
|
|
[90m>[39m [37mnull[39m> ^D
|
2022-02-21 00:25:46 +03:00
|
|
|
|
null> )
|
|
|
|
|
^ unexpected token ")"
|
2022-03-03 23:23:31 +03:00
|
|
|
|
null>
|
2021-08-14 20:50:17 +03:00
|
|
|
|
null> abc
|
2022-02-18 02:47:17 +03:00
|
|
|
|
error: expr: function not defined: abc/0
|
2021-08-14 20:50:17 +03:00
|
|
|
|
null> 1+"a"
|
|
|
|
|
error: cannot add: number (1) and string ("a")
|
2022-02-21 00:25:46 +03:00
|
|
|
|
null> abc | repl
|
|
|
|
|
error: expr: function not defined: abc/0
|
|
|
|
|
null> "a"+1 | repl
|
|
|
|
|
error: cannot add: string ("a") and number (1)
|
|
|
|
|
> empty> ^D
|
|
|
|
|
null> repl | 1
|
|
|
|
|
error: repl must be last in pipeline. ex: ... | repl
|
2021-08-14 20:50:17 +03:00
|
|
|
|
null> 1 | repl
|
|
|
|
|
> number> .+1
|
|
|
|
|
2
|
|
|
|
|
> number> ^D
|
2021-08-19 19:11:37 +03:00
|
|
|
|
null> 1 | 2 | repl
|
|
|
|
|
> number> .+1
|
|
|
|
|
3
|
|
|
|
|
> number> ^D
|
|
|
|
|
null> 1,2,3 | repl
|
2022-01-10 16:38:45 +03:00
|
|
|
|
> number, ...[0:3][]> .
|
2021-08-14 20:50:17 +03:00
|
|
|
|
1
|
|
|
|
|
2
|
|
|
|
|
3
|
2022-01-10 16:38:45 +03:00
|
|
|
|
> number, ...[0:3][]> ^D
|
2022-02-21 00:25:46 +03:00
|
|
|
|
null> 1,error("err"),3 | repl
|
|
|
|
|
error: err
|
|
|
|
|
> number> .
|
|
|
|
|
1
|
|
|
|
|
> number> ^D
|
2021-10-22 01:17:46 +03:00
|
|
|
|
null> (1 | raw | .unknown0), 1 | repl
|
2022-01-10 16:38:45 +03:00
|
|
|
|
> .unknown0 string, ...[0:2][]> ^D
|
2021-09-04 01:54:51 +03:00
|
|
|
|
null> def f: 1; f,f | repl
|
2022-01-10 16:38:45 +03:00
|
|
|
|
> number, ...[0:2][]> .
|
2021-09-04 01:54:51 +03:00
|
|
|
|
1
|
|
|
|
|
1
|
2022-01-10 16:38:45 +03:00
|
|
|
|
> number, ...[0:2][]> ^D
|
2021-08-19 19:11:37 +03:00
|
|
|
|
null> [1,2,3] | repl
|
2022-01-10 16:38:45 +03:00
|
|
|
|
> [number, ...][0:3]> .
|
2021-09-02 20:42:23 +03:00
|
|
|
|
[
|
|
|
|
|
1,
|
|
|
|
|
2,
|
|
|
|
|
3
|
|
|
|
|
]
|
2022-01-10 16:38:45 +03:00
|
|
|
|
> [number, ...][0:3]> ^D
|
2021-08-19 19:11:37 +03:00
|
|
|
|
null> [1] | repl
|
2021-09-02 20:42:23 +03:00
|
|
|
|
> [number]> .
|
|
|
|
|
[
|
|
|
|
|
1
|
|
|
|
|
]
|
|
|
|
|
> [number]> ^D
|
2022-02-21 00:25:46 +03:00
|
|
|
|
null> 1,2,error("err"),3 | repl
|
|
|
|
|
error: err
|
|
|
|
|
> number, ...[0:2][]> .
|
|
|
|
|
1
|
|
|
|
|
2
|
|
|
|
|
> number, ...[0:2][]> ^D
|
|
|
|
|
null> repl(123)
|
|
|
|
|
error: expr: options must be an object
|
|
|
|
|
null> repl(123; 123)
|
|
|
|
|
error: expr: repl requires none or one options argument. ex: ... | repl or ... | repl({compact: true})
|
2021-08-19 19:11:37 +03:00
|
|
|
|
null> [] | repl
|
|
|
|
|
> []> ^D
|
2021-08-14 20:50:17 +03:00
|
|
|
|
null> ^D
|
|
|
|
|
$ fq -i 'empty'
|
|
|
|
|
empty> 1
|
|
|
|
|
empty> ^D
|
2021-08-19 19:11:37 +03:00
|
|
|
|
$ fq -i 1,2,3
|
2022-01-10 16:38:45 +03:00
|
|
|
|
number, ...[0:3][]> .*2
|
2021-08-19 19:11:37 +03:00
|
|
|
|
2
|
|
|
|
|
4
|
|
|
|
|
6
|
2022-02-21 00:25:46 +03:00
|
|
|
|
number, ...[0:3][]> .*2 | repl
|
|
|
|
|
> number, ...[0:3][]> .
|
|
|
|
|
2
|
|
|
|
|
4
|
|
|
|
|
6
|
|
|
|
|
> number, ...[0:3][]> ^D
|
2022-01-10 16:38:45 +03:00
|
|
|
|
number, ...[0:3][]> ^D
|
2021-08-19 19:11:37 +03:00
|
|
|
|
$ fq -i '[1,2,3]'
|
2022-01-10 16:38:45 +03:00
|
|
|
|
[number, ...][0:3]> repl({compact: true})
|
|
|
|
|
> [number, ...][0:3]> tovalue
|
2021-08-19 19:11:37 +03:00
|
|
|
|
[1,2,3]
|
2022-01-10 16:38:45 +03:00
|
|
|
|
> [number, ...][0:3]> ^D
|
|
|
|
|
[number, ...][0:3]> ^D
|
2022-05-21 20:33:52 +03:00
|
|
|
|
$ fq -i -d mp3 '.headers[0]' test.mp3
|
2021-10-27 17:40:39 +03:00
|
|
|
|
.headers[0] id3v2> ^D
|
2022-05-21 20:33:52 +03:00
|
|
|
|
$ fq -i -d mp3 . test.mp3
|
2021-10-28 12:18:01 +03:00
|
|
|
|
mp3> .headers[0] | repl
|
2021-10-27 17:40:39 +03:00
|
|
|
|
> .headers[0] id3v2> ^D
|
2021-10-28 12:18:01 +03:00
|
|
|
|
mp3> ^D
|
2022-05-21 20:33:52 +03:00
|
|
|
|
$ fq -i -d json . test.mp3
|
2021-10-28 12:18:01 +03:00
|
|
|
|
json!> ^D
|
|
|
|
|
$ fq -i -n '"[]" | json'
|
|
|
|
|
json> ^D
|
2021-09-07 19:02:14 +03:00
|
|
|
|
$ fq -n repl
|
2022-02-21 00:25:46 +03:00
|
|
|
|
exitcode: 3
|
2021-09-07 19:02:14 +03:00
|
|
|
|
stderr:
|
2022-02-21 00:25:46 +03:00
|
|
|
|
error: arg: repl can only be used from interactive repl
|