forked from astrails/r2shell
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.rb
More file actions
56 lines (43 loc) · 739 Bytes
/
Copy pathtest.rb
File metadata and controls
56 lines (43 loc) · 739 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
require 'rubygems'
require 'ruby-debug'
require 'pp'
$:.unshift "lib"
require 'r2shell'
$TEST = true
R2shell do
res = ls("-l")
cd "/"
res = ls("-l")
echo("abc") | sed("s/b/B/")
pwd
cd "/"
pwd
puts ls.grep(/mac/)
if true
echo "if block"
puts echo("if block puts")
end
echo "if exp" if true
for d in ["/", "/bin"] do
echo d
echo "usr#{d}"
end
for a in [ 1, 2, 3] do
echo "for exp"
end
[1, 2, 3].each do
echo "iter block 1"
echo "iter block 1"
end
[1, 2, 3].each do |x|
echo "iter block 2 #{x}"
echo "iter block 2 #{x}"
end
[ 1, 2, 3].each do
echo "iter exp 1"
end
[ 1, 2, 3].each do |x|
echo "iter exp 2"
end
puts ls.grep(/mac/)
end