Get system command output: Difference between revisions

Added Quackery.
(Added Quackery.)
Line 1,170:
<pre>
[1] " 49 /etc/passwd" " 80 /etc/group" " 129 total"
</pre>
 
=={{header|Quackery}}==
 
As a dialogue in the Quackery shell. Execute the system command ls and store the result on the Quackery data stack as a string. Reverse that string and print onscreen.
 
 
<pre>/O> $ /
... import subprocess
... string_to_stack(str(subprocess.check_output('ls'),encoding='utf-8'))
... / python
... reverse echo$
...
 
ykq.kcudeltrut
yrdnus
yp.yrekcauq
ykq.Xsnoisnetxe
ykq.targib
fdp.yrekcauQ fo kooB ehT
fdp.tnirp rof yrekcauQ fo kooB ehT
txt.TSRIF EM DAER
fdp.ecnerefeR kciuQ yrekcauQ
</pre>
 
1,462

edits