Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,3 @@
---
from: http://rosettacode.org/wiki/Shell_one-liner
note: Programming environment operations

View file

@ -0,0 +1,6 @@
;Task:
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.
<br><br>

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 @@
osascript -e 'say "Hello, World!"'

View file

@ -0,0 +1 @@
$ arturo -e:"print {Hello World!}"

View file

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

View file

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

View file

@ -0,0 +1 @@
echo "PRINT \"Hello World\" " > a.bac && bacon a && ./a

View file

@ -0,0 +1 @@
$ echo 'print "Hello "; var=99; ++var + 20 + 3' | bc

View file

@ -0,0 +1 @@
bracmat "put$tay$(e^x,x,20)&"

View file

@ -0,0 +1 @@
bracmat 'put$tay$(e^x,x,10)&'

View file

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

View file

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

View file

@ -0,0 +1,3 @@
> Add-Type -TypeDefinition "public class HelloWorld { public static void SayHi() { System.Console.WriteLine(""Hi!""); } }"
> [HelloWorld]::SayHi()
Hi!

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 @@
echo 'display "hello".' | cobc -xFj -frelax -

View file

@ -0,0 +1 @@
echo 'id division. program-id. hello. procedure division. display "hello".' | cobc -xFj -

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 @@
echo program Prog;begin writeln('Hi');end. >> "./a.dpt" & dcc32 -Q -CC -W- "./a.dpt" & a.exe

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,2 @@
$ elixir -e "IO.puts 'Hello, World!'"
Hello, World!

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 @@
$ es -c 'if {test 5 -lt 6} {echo ok}'

View file

@ -0,0 +1,2 @@
> echo printfn "Hello from F#" | fsi --quiet
Hello from F#

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 @@
$ gawk 'BEGIN{print"write(6,\"(2(g12.3,x))\")(i/10.0,besj1(i/10.0), i=0,1000)\nend";exit(0)}'|gfortran -ffree-form -x f95 - | gnuplot -p -e 'plot "<./a.out" t "Bessel function of 1st kind" w l'

View file

@ -0,0 +1 @@
echo "begin writeLn('Hi'); end." | ifpc /dev/stdin

View file

@ -0,0 +1,4 @@
' FB 1.05.0 Win64
Shell "echo For i As Integer = 1 To 10 : Print i : Next > zzz.bas && fbc zzz.bas && zzz"
Sleep

View file

@ -0,0 +1 @@
$ frink -e "factorFlat[2^67-1]"

View file

@ -0,0 +1 @@
window 1,,(0,0,160,120):Str255 a:open "Unix",1,"cal 10 2018":do:line input #1,a:print a:until eof(1):close 1:HandleEvents

View file

@ -0,0 +1,5 @@
Public Sub Main()
Shell "echo Hello World"
End

View file

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

View file

@ -0,0 +1 @@
echo 'package main;func main(){println("hlowrld")}'>/tmp/h.go;go run /tmp/h.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 @@
$ huginn -c '"Hello"'

View file

@ -0,0 +1 @@
$ huginn -c 'print("Hello\n")'

View file

@ -0,0 +1 @@
$ huginn -c 'print("Hello\n");'

View file

@ -0,0 +1 @@
echo "procedure main();write(\"hello\");end" | icont - -x

View file

@ -0,0 +1 @@
echo "procedure main();write(\"hello world\");end" >hello.icn; unicon hello.icn -x

View file

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

View file

@ -0,0 +1,2 @@
$ :|jconsole -js "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,2 @@
$ jq -M -n 1+1
2

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 @@
$ lang -e "fn.println(Hello World)"

View file

@ -0,0 +1 @@
$ langur -e 'writeln "Are we reaching Fiji?"'

View file

@ -0,0 +1 @@
C:\> langur /e 'writeln "Are we reaching Fiji?"'

View file

@ -0,0 +1 @@
echo " 'The date and time is: ' + date " | lasso9 --

View file

@ -0,0 +1 @@
$ lasso9 -s " 'The date and time is: ' + date "

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 @@
maple -c'print(HELLO);' -cquit

View file

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

View file

@ -0,0 +1 @@
min -e:"\"hi from min\" puts!"

View file

@ -0,0 +1 @@
nq -e "println \"Hello Nanoquery!\""

View file

@ -0,0 +1 @@
let x 15 ask turtles [ set xcor x set x x + 1 ]

View file

@ -0,0 +1 @@
right random 90 forward 10

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,2 @@
$ echo 'print_endline "Hello"' | ocaml -stdin
Hello

View file

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

View file

@ -0,0 +1,2 @@
$ octave --eval 'printf("Hello World, it is %s!\n",datestr(now));'
Hello World, it is 28-Aug-2013 17:53:47!

View file

@ -0,0 +1 @@
oforth --P"1000 seq map(#sqrt) sum print"

View file

@ -0,0 +1 @@
rexx -e "say 'Goodbye, world.'"

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 @@
$ 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 @@
mkdir -p Tmp; echo "println(\"hello world\");" > Tmp/Tmp.pde; processing-java --sketch="`pwd`/Tmp" --run

View file

@ -0,0 +1,3 @@
$ swipl -g "writeln('hello world')." -t 'halt.'
hello world
$

View file

@ -0,0 +1,3 @@
$ gprolog --init-goal "write('goodbye'),nl,halt"
goodbye
$

View file

@ -0,0 +1,2 @@
$ yap -q -g "current_prolog_flag(dialect, D), writeln(D), halt"
yap

View file

@ -0,0 +1,5 @@
$ swipl -q <<< "current_prolog_flag(dialect,D), writeln(D), halt."
swi
$ yap -q <<< "current_prolog_flag(dialect,D), writeln(D), halt."
yap

View file

@ -0,0 +1,5 @@
$ echo "current_prolog_flag(dialect,D), writeln(D), halt." | swipl -q
swi
$ echo "current_prolog_flag(dialect,D), writeln(D), halt." | yap -q
yap

Some files were not shown because too many files have changed in this diff Show more