date()
system("hostname")
getwd()
<<dir-test-R>>
<<dir-test-R>>
system("date")
system("hostname")
system("pwd")
<<dir-test-ruby>>
<<dir-test-ruby>>
import os, time
print time.ctime()
print os.uname()
print os.getcwd()
<<dir-test-python>>
shellcode
date
hostname
pwd
<<dir-test-shell>>
<<dir-test-shell>>
string
'string from octave'
(cd “/ddavison@tombstone.princeton.edu:”)
into matlab-shell.
magic(3)
'string from matlab'
<<dir-test-R>>
rubylocal
<<dir-test-ruby>>
shelllocal
<<dir-test-shell>>
perlcode
system("date");
system("hostname");
system("pwd");
<<dir-test-perl>>
<<dir-test-perl>>
6 * exp(i*pi)
Rcode
c(date(), system("hostname", intern=TRUE), getwd())
<<dir-test-R-value>>
local
<<dir-test-ruby-value>>
<<dir-test-ruby-value>>
import os, time
[time.ctime(), os.uname(),os.getcwd()]
<<dir-test-python-value>>
local But Looks like a shell ‘:session :results value’ bug here.
<<dir-test-shell-value>>
<<dir-test-shell-value>>
ans = z^3
ans = 'string from octave with 100%'
1 | 2 | 3 |
1 | 2 | 3 |
4 | 5 | 6 |
x+0
x+0
magic(3)
'string from matlab'
<<dir-test-R-value>>
rubylocal
<<dir-test-ruby-value>>
[1,2]
import os, time
return [time.ctime(), os.uname(),os.getcwd()]
<<dir-test-python-value-nonsession>>
shelllocal
<<dir-test-shell-value>>
<<dir-test-shell-value>>
(`date`,`hostname`,`pwd`) ;
<<dir-test-perl-value>>
<<dir-test-perl-value>>
(+ 2 2)
(+ 2 33)
(+ 2 2)
z / 100
['tab with', 'embedded tabs']
[z / 6; z / 7]
'string from matlab'
mkdir -p /tmp/images
+-----------+
| cBLU |
| Org |
| +------+
| |cPNK |
| |babel |
| | |
+----+------+
$e^{i\pi} = -1$
#+source R-dir-eg
curve(sin(x), 0, 2*pi)
independent var | first dependent var | second dependent var |
---|---|---|
0.1 | 0.425 | 0.375 |
0.2 | 0.3125 | 0.3375 |
0.3 | 0.24999993 | 0.28333338 |
0.4 | 0.275 | 0.28125 |
0.5 | 0.26 | 0.27 |
0.6 | 0.25833338 | 0.24999993 |
0.7 | 0.24642845 | 0.23928553 |
0.8 | 0.23125 | 0.2375 |
0.9 | 0.23333323 | 0.2333332 |
1 | 0.2225 | 0.22 |
1.1 | 0.20909075 | 0.22272708 |
1.2 | 0.19999998 | 0.21458333 |
1.3 | 0.19615368 | 0.21730748 |
set title "Implementing Gnuplot"
plot data using 1:2 with lines
But not during export
+-----------+
| cBLU |
| Org |
| +------+
| |cPNK |
| |babel |
| | |
+----+------+
$e^{i\pi} = -1$
curve(sin(x), 0, 2*pi)
Looks like gnuplot doesn’t respond to default-directory. I think that is because shell-command-to-string uses call-process instead of process-file. We may want to use shell-command-on-region or shell-command.
set title "Implementing Gnuplot"
plot data using 1:2 with lines
Shell worked from the start
localcat /nothere
Shell command exited with code 1 Traceback (most recent call last): File "<stdin>", line 5, in <module> File "<stdin>", line 3, in main Exception: Something went wrongremote
import os
raise Exception('Something went wrong on %s %s %s %s %s' % os.uname())
import sys
sys.stdout.write("this is on stdout!")
sys.stderr.write("this is on stderr!")
- State “DONE” from “TODO” [2010-03-01 Mon 09:21]
- State “TODO” from “” [2010-03-01 Mon 09:20]
stop("Error message!")
cat("This is on stderr\n", file=stderr())
1:3
- State “DEFERRED” from “” [2010-03-01 Mon 09:33]
Output to minibuffer and Messages
(error "Error message!")
- State “DONE” from “TODO” [2010-03-01 Mon 09:37]
- State “TODO” from “” [2010-03-01 Mon 09:20]
- State “DONE” from “TODO” [2010-03-01 Mon 09:36]
- State “TODO” from “” [2010-03-01 Mon 09:20]
$dummy = 1
split " ", "1 2 3"
$dummy = 1
split " ", "1 2 3"
- State “DONE” from “TODO” [2010-03-01 Mon 09:36]
- State “TODO” from “” [2010-03-01 Mon 09:20]
die "Error message!";
split " ", "1 2 3";
Write to stderr I’m not sure why that’s 16
$stderr.write "Hello on stderr\n"
$stdout.write "Hello on stdout\n"
No error
(+ 2 2)
import sys
sys.stdout.write("this is on stdout!\n")
sys.stderr.write("this is on stderr!\n")
cat("This is on stderr\n", file=stderr())
If window is visible, point moves; if not it doesn’t.
(setq comint-move-point-for-output t) ;; doesn’t solve it
b=10
b
a=6
a
plot(1, main="i")
$e^{i\pi} \neq -6$
mogrify -resize 200% $file
echo $file
2+2
system("hostname", intern=TRUE)