all tasks

This commit is contained in:
Ingy döt Net 2013-04-11 01:07:29 -07:00
parent b83f433714
commit 68f8f3e56b
14735 changed files with 178959 additions and 0 deletions

View file

@ -0,0 +1,3 @@
Show how to specify and execute a short program in the language from a command shell, where the input to the command shell is only one line in length.
Avoid depending on the particular shell or operating system used as much as is reasonable; if the language has notable implementations which have different command argument syntax, or the systems those implementations run on have different styles of shells, it would be good to show multiple examples.

View file

@ -0,0 +1,2 @@
---
note: Programming environment operations

View file

@ -0,0 +1 @@
$ acl2 <<< '(cw "Hello.")'

View file

@ -0,0 +1 @@
$ a68g -e 'print(("Hello",new line))'

View file

@ -0,0 +1,6 @@
code='print(("Hello", new line))'
a=/tmp/algol$$ s=/usr/share/algol68toc;
echo -e "PROGRAM algol$$ CONTEXT VOID\nUSE standard\nBEGIN\n$code\nEND\nFINISH\n" > $a.a68 &&
a68toc -lib $s -dir $s -uname TMP -tmp $a.a68 && rm $a.a68 &&
gcc $s/Afirst.o $a.c -l{a68s,a68,m,c} -o $a && rm $a.c &&
$a; rm $a

View file

@ -0,0 +1 @@
$ awk 'BEGIN { print "Hello"; }'

View file

@ -0,0 +1 @@
$ awk '/IN/ { print $2, $4; }' <input.txt

View file

@ -0,0 +1 @@
echo 'with Ada.text_IO; use Ada.text_IO; procedure X is begin Put("Hello!"); end X;' > x.adb; gnatmake x; ./x; rm x.adb x.ali x.o x

View file

@ -0,0 +1 @@
echo 'println ("Hello")' | aikido

View file

@ -0,0 +1 @@
$ src/aime -c 'o_text("Hello, World!\n");'

View file

@ -0,0 +1 @@
echo 'print "foo"'|basic

View file

@ -0,0 +1 @@
echo print "foo"|basic

View file

@ -0,0 +1 @@
PRINT "Hello World!"

View file

@ -0,0 +1 @@
Burlesque.exe --no-stdin "5 5 .+"

View file

@ -0,0 +1 @@
$ echo 'main() {printf("Hello\n");}' | gcc -w -x c -; ./a.out

View file

@ -0,0 +1 @@
echo 'message(STATUS "Goodbye, World!")' | cmake -P /dev/stdin

View file

@ -0,0 +1,3 @@
$ clj-env-dir -e "(defn add2 [x] (inc (inc x))) (add2 40)"
#'user/add2
42

View file

@ -0,0 +1 @@
sbcl --noinform --eval '(progn (princ "Hello") (terpri) (quit))'

View file

@ -0,0 +1 @@
clisp.exe -q -x "(progn (format t \"Hello from CLISP\") (quit))"

View file

@ -0,0 +1 @@
rdmd --eval="writeln(q{Hello World!})"

View file

@ -0,0 +1 @@
dc -e '22 7/p'

View file

@ -0,0 +1 @@
rune --src.e 'println("Hello")'

View file

@ -0,0 +1 @@
rune --src.e-awt 'def f := &lt;swing:makeJFrame>("Hello"); f.show(); f.addWindowListener(def _{to windowClosing(_) {interp.continueAtTop()} match _{}}); interp.blockAtTop()'

View file

@ -0,0 +1 @@
emacs -batch -eval '(princ "Hello World!\n")'

View file

@ -0,0 +1 @@
emacs -batch sample.c --eval '(indent-region (point-min) (point-max) nil)' -f save-buffer

View file

@ -0,0 +1,2 @@
$ erl -noshell -eval 'io:format("hello~n").' -s erlang halt
hello

View file

@ -0,0 +1 @@
$ factor -run=none -e="USE: io \"hi\" print"

View file

@ -0,0 +1,2 @@
$ gforth -e ".( Hello) cr bye"
Hello

View file

@ -0,0 +1,2 @@
$ gema -p '\B=Hello\n@end'
Hello

View file

@ -0,0 +1 @@
echo 'package main;func main(){println("hllowrld")}'>8.go;8g 8.go;8l 8.8;8.out

View file

@ -0,0 +1 @@
echo 'package main;func main(){println("hllowrld")}'>/tmp/8.go;gorun /tmp/8.go

View file

@ -0,0 +1,2 @@
$ groovysh -q "println 'Hello'"
Hello

View file

@ -0,0 +1,2 @@
C:\Users\user> groovysh -q "println 'Hello'"
Hello

View file

@ -0,0 +1,2 @@
$ ghc -e 'putStrLn "Hello"'
Hello

View file

@ -0,0 +1,2 @@
$ jconsole -js "exit echo 'Hello'"
Hello

View file

@ -0,0 +1,3 @@
$ echo 'public class X{public static void main(String[]args){' \
> 'System.out.println("Hello Java!");}}' >X.java
$ javac X.java && java X

View file

@ -0,0 +1 @@
$ echo 'public class X{public static void main(String[]args){System.out.println("Hello Java!");}}'>X.java;javac X.java&&java X

View file

@ -0,0 +1,2 @@
C:\>echo public class X{public static void main(String[] args){System.out.println("Hello Java!");}}>X.java&&javac X.java&&java X
Hello Java!

View file

@ -0,0 +1,2 @@
$ js -e 'print("hello")'
hello

View file

@ -0,0 +1,3 @@
$ julia -e 'for x in ARGS; println(x); end' foo bar
foo
bar

View file

@ -0,0 +1 @@
$ k -e "\`0: \"hello\\n\""

View file

@ -0,0 +1 @@
echo print "hello">oneLiner.bas & liberty -r oneLiner.bas echo print "hello">oneLiner.bas & liberty -r oneLiner.bas

View file

@ -0,0 +1 @@
lua -e 'print "Hello World!"'

View file

@ -0,0 +1 @@
echo Print[2+2] > file & math.exe -script file

View file

@ -0,0 +1 @@
$ TNRX=`mktemp T_XXXXXXXXXXXX` && test ! -e $TNRX.* && (echo 'say "Goodbye, World!"' >$TNRX; nrc -exec $TNRX; rm $TNRX $TNRX.*; unset TNRX)

View file

@ -0,0 +1,2 @@
newlisp -e "\"Hello\"
->"Hello"

View file

@ -0,0 +1,2 @@
$ ocaml <(echo 'print_endline "Hello"')
Hello

View file

@ -0,0 +1 @@
./obc -run '"Hello"->PrintLine();' -dest hello.obe ; ./obr hello.obe

View file

@ -0,0 +1,2 @@
echo >tmp.oz "{System.show hello}"; ozc -l System -e tmp.oz
hello

View file

@ -0,0 +1 @@
echo "print(Pi)" | gp -q

View file

@ -0,0 +1,2 @@
$ php -r 'echo "Hello\n";'
Hello

View file

@ -0,0 +1,2 @@
$ echo "begin writeln('Hello World') end." >OneLiner.pas; fpc -Fe/dev/null OneLiner.pas; ./OneLiner
Hello World

View file

@ -0,0 +1,2 @@
$ perl6 -e 'say "Hello, world!"'
Hello, world!

View file

@ -0,0 +1,2 @@
$ perl -e 'print "Hello\n"'
Hello

View file

@ -0,0 +1,2 @@
$ picolisp -'prinl "Hello world!"' -bye
Hello world!

View file

@ -0,0 +1,2 @@
$ pike -e 'write("Hello\n");'
Hello

View file

@ -0,0 +1,2 @@
> powershell -Command "Write-Host 'Hello'"
Hello

View file

@ -0,0 +1 @@
$ echo 'messagerequester("Greetings","hello")' > "dib.pb" && ./pbcompiler dib.pb -e "dib" && ./dib

View file

@ -0,0 +1,2 @@
$ python -c 'print "Hello"'
Hello

View file

@ -0,0 +1 @@
python -m CGIHTTPServer

View file

@ -0,0 +1,2 @@
$ echo 'cat("Hello\n")' | R --slave
Hello

View file

@ -0,0 +1,2 @@
$ Rscript -e 'cat("Hello\n")'
Hello

View file

@ -0,0 +1 @@
rebview -vswq --do "print {Hello!} quit"

View file

@ -0,0 +1,5 @@
from the MS Windows® command line (cmd.exe)
echo do j=10 by 20 for 4;say right('hello',j);end | regina

View file

@ -0,0 +1,2 @@
$ racket -e "(displayln \"Hello World\")"
Hello World

View file

@ -0,0 +1 @@
echo '"hello\n" puts bye' | ./retro

View file

@ -0,0 +1,2 @@
$ ruby -e 'puts "Hello"'
Hello

View file

@ -0,0 +1,2 @@
$ jruby -e 'puts "Hello from JRuby"'
Hello from JRuby

View file

@ -0,0 +1,2 @@
$ rbx -e 'puts "Hello from Rubinius"'
Hello from Rubinius

View file

@ -0,0 +1 @@
print shell$("echo hello world")

View file

@ -0,0 +1 @@
echo 'a output = "Hello, World!";end' | snobol4 -b

View file

@ -0,0 +1 @@
snobol4 -b <<<'a output = "Hello, World!";end'

View file

@ -0,0 +1,2 @@
C:\>scala -e "println(\"Hello\")"
Hello

View file

@ -0,0 +1 @@
guile -c '(display "Hello, world!\n")'

View file

@ -0,0 +1 @@
shiny -e "say 'hi'"

View file

@ -0,0 +1 @@
./slate --eval "[inform: 'hello'] ensure: [exit: 0].".

View file

@ -0,0 +1,4 @@
$ echo 123-456-7890 | txr -c '@a-@b-@c' -
a="123"
b="456"
c="7890"

View file

@ -0,0 +1,2 @@
$ echo 'puts Hello' | tclsh
Hello

View file

@ -0,0 +1 @@
$ sh -c ls

View file

@ -0,0 +1 @@
$ sh -c "echo hello"

View file

@ -0,0 +1,3 @@
$ bash -c 'paste <(echo 1) <(echo 2)'
$ ksh -c 'let i=3+4; print $i'
$ zsh -c 'if [[ 5 -lt 6 ]] { echo ok };'

View file

@ -0,0 +1,3 @@
$ VAR=`echo hello` # obsolescent backtick notation
$ VAR=$(echo hello) # modern POSIX notation
$ (echo hello) # execute in another shell process, not in this one

View file

@ -0,0 +1 @@
$ csh -fc 'if (5 < 6) echo ok'

View file

@ -0,0 +1 @@
$ es -c 'if {test 5 -lt 6} {echo ok}'

View file

@ -0,0 +1,6 @@
$ fun --main=-[hello]- --show
hello
$ fun --main="power/2 32" --cast %n
4294967296
$ fun --m="..mp2str mpfr..pi 120" --c %s
'3.1415926535897932384626433832795028847E+00'

View file

@ -0,0 +1 @@
vpw -c'Get_Key("Hello!") exit'