Execute a system command: Difference between revisions

m
no edit summary
(added Quackery.)
mNo edit summary
Line 240:
print (("test.tmp now gone!", new line))
FI</lang>
 
 
=={{header|Amazing Hopper}}==
<lang Amazing Hopper>
#!/usr/bin/hopper
 
#include <hopper.h>
 
main:
 
/* execute "ls -lstar" with no result return (only displayed) */
{"ls -lstar"},execv
/* this form does not allow composition of the line with variables.
Save result in the variable "s", and then display it */
s=`ls -l | awk '{if($2=="2")print $0;}'`
{"\n",s,"\n"}print
data="2"
 
// the same as above, only I can compose the line:
{"ls -l | awk '{if($2==\"",data,"\")print $0;}'"}join(s),{s}exec,print
{"\n\n"}print
// this does the same as above, with an "execute" macro inside a "let" macro:
t=0,let (t := execute( {"ls -l | awk '{if($2==\""},{data},{"\")print $0;}'"} ))
{t,"\n"}print
 
{0}return
</lang>
 
=={{header|AppleScript}}==
543

edits