Shell one-liner: Difference between revisions

imported>Tromp
 
(168 intermediate revisions by 85 users not shown)
Line 1:
{{task|Programming environment operations}}
 
Show how to specify and execute a short program in the language from a command shell.
;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>
 
=={{header|11l}}==
{{trans|Nim}}
The following works on Windows.
<pre>...>echo L(i) 0..10 {print("Hello World"[0..i])} > oneliner.11l && 11l oneliner.11l && oneliner.exe
H
He
Hel
Hell
Hello
Hello
Hello W
Hello Wo
Hello Wor
Hello Worl
Hello World
</pre>
 
=={{header|ACL2}}==
<syntaxhighlight lang="bash">$ acl2 <<< '(cw "Hello.")'</syntaxhighlight>
 
=={{header|Ada}}==
{{works with|gnat}}
'''under a unixoid shell''' (bash, sh, ...)
 
<syntaxhighlight lang="bash">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</syntaxhighlight>
 
Note that this mercilessly overwrites and later deletes any files x.adb, x.ali, x,o and x in the current directory.
 
=={{header|Aikido}}==
<syntaxhighlight lang="aikido">echo 'println ("Hello")' | aikido</syntaxhighlight>
<lang aikido>
 
echo 'println ("Hello")' | aikido
=={{header|Aime}}==
</lang>
<syntaxhighlight lang="sh">$ src/aime -c 'o_text("Hello, World!\n");'</syntaxhighlight>
 
=={{header|ALGOL 68}}==
{{works with|ALGOL 68G|Any - tested with release mk15-0.8b.fc9.i386 - Interpret straight off}}
<presyntaxhighlight lang="bash">$ a68g -e 'print(("Hello",new line))'</presyntaxhighlight>
Output:
<pre>Hello</pre>
{{works with|ELLA ALGOL 68|Any - tested with release 1.8.8d.fc9.i386 - translate to [[C]] and then compile and run}}
For an [[ELLA ALGOL 68]] one-liner, merge these lines of shell code:
<presyntaxhighlight lang="bash">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</presyntaxhighlight>
Output:
<pre>Hello</pre>
 
=={{header|AutoHotkeyAppleScript}}==
<syntaxhighlight lang="applescript">osascript -e 'say "Hello, World!"'</syntaxhighlight>
<lang autohotkey>RunWait, %comspec% /c systeminfo > tmp,,Hide
FileRead, var, tmp
FileDelete, tmp
MsgBox,% var</lang>
 
=={{header|AWKArturo}}==
 
You may run any arbitrary code string directly using the <code>-e</code> (or <code>--evaluate</code>) flag:
Maybe the most common way one can use awk is from the command line for one-liners, feeding the interpreter with an input.
 
<presyntaxhighlight lang="bash">$ awk 'BEGIN {arturo -e:"print "{Hello"; World!}'"</presyntaxhighlight>
 
{{out}}
A more "complex" and "real" example:
 
<pre>$Hello awk '/IN/ { print $2, $4; }' <input.txtWorld!</pre>
 
=={{header|AWK}}==
Maybe the most common way one can use awk is from the command line for one-liners, feeding the interpreter with an input.
<syntaxhighlight lang="bash">$ awk 'BEGIN { print "Hello"; }'</syntaxhighlight>
 
A more "complex" and "real" example:
<syntaxhighlight lang="bash">$ awk '/IN/ { print $2, $4; }' <input.txt</syntaxhighlight>
 
''Select'' field 2 and 4 of lines matching the regular expression <tt>/IN/</tt> (i.e. where IN appears)
 
=={{header|BASIC}}==
 
The name of the BASIC executable will vary (common ones are ''basic'', ''bas'', and ''bwbasic''), but in general, a short program can be piped to the interpreter like any other language:
<langsyntaxhighlight lang="bash">echo 'print "foo"'|basic</langsyntaxhighlight>
 
Note that under Windows (and presumably DOS) the two apostrophes (a.k.a. single quotes) should be omitted, since Windows doesn't remove them from the piped text (and the apostrophe is the comment character in many modern BASICs):
<langsyntaxhighlight lang="dos">echo print "foo"|basic</langsyntaxhighlight>
 
Also, some popular interpreters (including [http://www.moria.de/~michael/bas/ Michael Haardt's '''bas'''] and [[Chipmunk Basic]]) will include an extra prompt before exiting unless you include <code>exit</code> or <code>system</code> (depending on the specific interpreter's syntax). This sample output shows both with and without <code>system</code> in bas:
Line 66 ⟶ 101:
Note that this is rather specific to [[Unix]]-like systems; most [[DOS]] and [[Windows]] interpreters are generally unable to handle programs in this manner, unless they were ported from a *nix system in the first place.
 
=== {{Headerheader|ZX Spectrum Basic}} ===
 
On the ZX Spectrum, the ROM basic allows direct commands to be entered from the system prompt:
 
<syntaxhighlight lang="zxbasic">PRINT "Hello World!"</syntaxhighlight>
<lang zxbasic>
 
PRINT "Hello World!"
==={{header|BaCon}}===
</lang>
BaCon is not an interpreter so we need to compile the code
a short explanation echo a command to file a.bac
then compile a.bac using bacon then run ./a
 
<syntaxhighlight lang="bash">
echo "PRINT \"Hello World\" " > a.bac && bacon a && ./a
</syntaxhighlight>
 
Converting 'a.bac'... done, 2 lines were processed in 0.003 seconds.
Compiling 'a.bac'... cc -c a.bac.c
cc -o a a.bac.o -lm
Done, program 'a' ready.
Hello World
 
=={{header|Bc}}==
<syntaxhighlight lang="bash">$ echo 'print "Hello "; var=99; ++var + 20 + 3' | bc</syntaxhighlight>
{{out}}
<pre>Hello 123</pre>
 
=={{header|Binary Lambda Calculus}}==
Several such one liners are shown on https://www.ioccc.org/2012/tromp/hint.html, such as
<syntaxhighlight lang="bash">echo "*Hello, world" | ./tromp</syntaxhighlight>
<syntaxhighlight lang="bash">echo "00010001100110010100011010000000010110000010010001010111110111101001000110100001110011010000000000101101110011100111111101111000000001111100110111000000101100000110110" | ./tromp -b | head -c 70</syntaxhighlight>
 
=={{header|Bracmat}}==
This example uses the predefined function <code>tay</code> to make a taylor expansion of <code>e^x</code>.
 
DOS:
<syntaxhighlight lang="bracmat">bracmat "put$tay$(e^x,x,20)&"</syntaxhighlight>
Linux:
<syntaxhighlight lang="bracmat">bracmat 'put$tay$(e^x,x,10)&'</syntaxhighlight>
Output:
<pre> 1
+ x
+ 1/2*x^2
+ 1/6*x^3
+ 1/24*x^4
+ 1/120*x^5
+ 1/720*x^6
+ 1/5040*x^7
+ 1/40320*x^8
+ 1/362880*x^9
+ 1/3628800*x^10
+ 1/39916800*x^11
+ 1/479001600*x^12
+ 1/6227020800*x^13
+ 1/87178291200*x^14
+ 1/1307674368000*x^15
+ 1/20922789888000*x^16
+ 1/355687428096000*x^17
+ 1/6402373705728000*x^18
+ 1/121645100408832000*x^19
+ 1/2432902008176640000*x^20</pre>
 
=={{header|Burlesque}}==
 
<syntaxhighlight lang="text">
Burlesque.exe --no-stdin "5 5 .+"
</syntaxhighlight>
 
Using the official interpreter.
 
=={{header|C}}==
{{works with|gcc}}
 
The following code leaves the file <tt>a.out</tt> in the current directory (it does not
delete it to avoid to call another shell/system dependent command/program). The
''current directory'' is not specified by <tt>./</tt> in every system...
<presyntaxhighlight lang="bash">$ echo 'main() {printf("Hello\n");}' | gcc -w -x c -; ./a.out</presyntaxhighlight>
 
=={{header|C sharp|C#}}==
Note: whilst small, this is more than one line.
 
Requires PowerShell 2:
<presyntaxhighlight lang="powershell">>&gt; Add-Type -TypeDefinition "public class HelloWorld { public static void SayHi() { System.Console.WriteLine(""Hi!""); } }"
&gt;> [HelloWorld]::SayHi()
Hi!</presyntaxhighlight>
 
=={{header|Clojure}}==
Note: whilst small, this is more than one line.
 
clj-env-dir comes with clojure-contrib.
 
<langsyntaxhighlight lang="bash">$ clj-env-dir -e "(defn add2 [x] (inc (inc x))) (add2 40)"
#'user/add2
42</syntaxhighlight>
42
</lang>
 
=={{header|CMake}}==
This only works with [[Unix]] systems that have the device node <code>/dev/stdin</code>.
 
<langsyntaxhighlight lang="bash">echo 'message(STATUS "Goodbye, World!")' | cmake -P /dev/stdin</langsyntaxhighlight>
 
=={{header|COBOL}}==
Works with GnuCOBOL 2.0 or later
 
<syntaxhighlight lang="bash">echo 'display "hello".' | cobc -xFj -frelax -</syntaxhighlight>
 
Longer, but avoids two relaxed syntax warnings:
<syntaxhighlight lang="bash">echo 'id division. program-id. hello. procedure division. display "hello".' | cobc -xFj -</syntaxhighlight>
 
=={{header|Common Lisp}}==
Line 106 ⟶ 210:
 
{{works with|SBCL}}
<langsyntaxhighlight lang="bash">sbcl --noinform --eval '(progn (princ "Hello") (terpri) (quit))'</langsyntaxhighlight>
{{works with|CLISP}}
<langsyntaxhighlight lang="bash">clisp.exe -q -x "(progn (format t \"Hello from CLISP\") (quit))"</langsyntaxhighlight>
 
=={{header|D}}==
{{works with|D|2}}
requires [https://github.com/D-Programming-Language/tools/blob/master/rdmd.d rdmd]
<langsyntaxhighlight lang="d">rdmd --eval="writeln(q{Hello World!})"</langsyntaxhighlight>
<pre>Hello World!</pre>
 
=={{header|Dc}}==
<syntaxhighlight lang="bash">dc -e '22 7/p'</syntaxhighlight>
=={{header|Delphi}}==
Run in cmd.exe.
<syntaxhighlight lang="batch">echo program Prog;begin writeln('Hi');end. >> "./a.dpt" & dcc32 -Q -CC -W- "./a.dpt" & a.exe</syntaxhighlight>
The output has the default Delphi header, before the output of executable ("Hi").
 
=={{header|E}}==
<syntaxhighlight lang="bash">rune --src.e 'println("Hello")'</syntaxhighlight>
{{lines_too_long}}
<lang bash>rune --src.e 'println("Hello")'</lang>
 
The <code>--src</code> option ends with the the filename extension the provided type of program would have:
 
<presyntaxhighlight lang="text">rune --src.e-awt 'def f := &lt;swing:makeJFrame>("Hello"); f.show(); f.addWindowListener(def _{to windowClosing(_) {interp.continueAtTop()} match _{}}); interp.blockAtTop()'</presyntaxhighlight>
 
=={{header|Emacs LispElixir}}==
<syntaxhighlight lang="elixir">$ elixir -e "IO.puts 'Hello, World!'"
 
Hello, World!</syntaxhighlight>
<lang bash>emacs -batch -eval '(princ "Hello World!\n")' </lang>
 
=={{header|Emacs Lisp}}==
<syntaxhighlight lang="bash">emacs -batch -eval '(princ "Hello World!\n")' </syntaxhighlight>
Or another example that does something useful: indent a [[C]] source file:
<syntaxhighlight lang="bash">emacs -batch sample.c --eval '(indent-region (point-min) (point-max) nil)' -f save-buffer</syntaxhighlight>
 
<lang bash>emacs -batch sample.c --eval '(indent-region (point-min) (point-max) nil)' -f save-buffer</lang>
 
=={{header|Erlang}}==
Erlang always starts other applications that can run in parallel in the background, and as such will not die by itself. To kill erl, we sequentially run the 'halt' function from the 'erlang' module (the -S is there to guarantee 'halt' will be evaluated after the io function).
<syntaxhighlight lang="bash">$ erl -noshell -eval 'io:format("hello~n").' -s erlang halt
hello</syntaxhighlight>
 
=={{header|F_Sharp|F#}}==
<syntaxhighlight lang="cmd">> echo printfn "Hello from F#" | fsi --quiet
Hello from F#</syntaxhighlight>
 
=={{header|Factor}}==
<syntaxhighlight lang="bash">$ factor -run=none -e="USE: io \"hi\" print"</syntaxhighlight>
 
=={{header|Forth}}==
{{works with|GNU Forth}}
<syntaxhighlight lang="bash">$ gforth -e ".( Hello) cr bye"
Hello</syntaxhighlight>
 
=={{header|GemaFortran}}==
This example, stolen from the [[Shell_one-liner#c|c]] example is subject to the same caveats. While contrived, FORTRAN as a one liner can easily handle some unique tasks. Let's plot a Bessel function:
$ gema -p '\B=Hello\n@end'
<syntaxhighlight lang="bash">
Hello
$ 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'
=={{header|Go}}==
</syntaxhighlight>
Go is first of all a compiled language and currently comes with no support for running as a script language. The compiler and linker can of course be run from a command line shell, as in,
Sorry, I don't know how to upload my jpeg file for the Image tag. Let's use the dumb display instead.
<pre>
0.6 +*------------+-------------+------------+-------------+------------++
echo 'package main;func main(){println("hllowrld")}'>8.go;8g 8.go;8l 8.8;8.out
+** + + Bessel function of 1st kind ****** +
0.5 +** ++
|** |
0.4 +** ++
* * |
0.3 *+* * ++
* * ** * |
0.2 *+* *** ** ** ++
0.1 *+* * * ** ** *** ** ** * ** * ++
* ** * * *** ** * * *** ** *** ** ** *** ** ** *** ** ** |
0 *+ * * * * * * * * * * * *** * * * * *** * * *** *** * * *** ***+
| * * * * *** * * * * *** * * * * *** *** * * **** *** *** *** *|
-0.1 ++ * * * * ** *** *** ** ** *** ** ** ** ** ** ** ** **
| *** *** ** ** ** ** * * |
-0.2 ++ ** ** ** ++
| ** * |
-0.3 ++ ** ++
+ ** + + + + +
-0.4 ++------------+-------------+------------+-------------+------------++
0 20 40 60 80 100
 
</pre>
This will overwrite existing files in the current directory 8.go, 8.8, and 8.out, assuming of course, that the the current directory is even writable, and will leave these files behind after executing.
 
=={{header|Free Pascal}}==
Running Go as a script language is a popular request however, and one of the better solutions currently is [https://wiki.ubuntu.com/gorun gorun]. Gorun has solutions for the temporary file problem, writing to best-guess temporary directories by default and having an option to specify the location when this is needed or desired. Gorun still expects to read the source code from a file however, so you are on your own to deal with this before passing the file to gorun. Example,
The FPC (Free Pascal compiler) comes with the utility <tt>instantfpc(1)</tt> or <tt>ifpc(1)</tt> for short (Debian or FreeBSD package <tt>fpc-utils</tt>):
<syntaxhighlight lang="bash">echo "begin writeLn('Hi'); end." | ifpc /dev/stdin</syntaxhighlight>
 
=={{header|FreeBASIC}}==
<syntaxhighlight lang="freebasic">' FB 1.05.0 Win64
 
Shell "echo For i As Integer = 1 To 10 : Print i : Next > zzz.bas && fbc zzz.bas && zzz"
Sleep</syntaxhighlight>
 
{{out}}
<pre>
1
echo 'package main;func main(){println("hllowrld")}'>/tmp/8.go;gorun /tmp/8.go
2
3
4
5
6
7
8
9
10
</pre>
 
Output from either example:
=={{header|Frink}}==
Frink is distributed as a single <CODE>.jar</CODE> file that will run in a Java Virtual Machine. On many operating systems, just double-clicking this <CODE>.jar</CODE> file will run Frink with a graphical interface in an interactive mode. By specifying a different main-class (<CODE>frink.parser.Frink</CODE>) when starting Frink, it can be run in text-mode interactive mode as well. These options and sample starter scripts for various operating systems are provided in the [https://frinklang.org/#RunningFrink Running Frink] section of the documentation.
 
The <CODE>-e</CODE> command-line option executes a command or commands and prints its value.
 
<syntaxhighlight lang="frink">$ frink -e "factorFlat[2^67-1]"</syntaxhighlight>
 
{{out}}
<pre>
[193707721, 761838257287]
</pre>
 
=={{header|FutureBasic}}==
This is forcing the issue. FB has much more elegant ways of interacting with the Unix Shell.
<syntaxhighlight lang="futurebasic">
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
</syntaxhighlight>
 
Output
<pre>
October 2018
Su Mo Tu We Th Fr Sa
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31
</pre>
 
=={{header|Gambas}}==
'''[https://gambas-playground.proko.eu/?gist=4385adf6a841435779a7afff3dadb58b Click this link to run this code]'''
<syntaxhighlight lang="gambas">Public Sub Main()
Shell "echo Hello World"
 
End</syntaxhighlight>
Output:
<pre>
Hello World
</pre>
 
=={{header|Gema}}==
<syntaxhighlight lang="bash">$ gema -p '\B=Hello\n@end'
Hello</syntaxhighlight>
 
=={{header|Go}}==
<syntaxhighlight lang="bash">echo 'package main;func main(){println("hlowrld")}'>/tmp/h.go;go run /tmp/h.go</syntaxhighlight>
{{out}}
<pre>
hlowrld
hllowrld
</pre>
 
=={{header|Groovy}}==
{{works with|UNIX Shell}}
<presyntaxhighlight lang="bash">$ groovysh -q "println 'Hello'"
Hello</presyntaxhighlight>
 
{{works with|Windows Command Interpreter}}
<presyntaxhighlight lang="cmd">C:\Users\user> groovysh -q "println 'Hello'"
Hello</presyntaxhighlight>
 
=={{header|Haskell}}==
<presyntaxhighlight lang="bash">$ ghc -e 'putStrLn "Hello"'
Hello</presyntaxhighlight>
 
=={{header|Huginn}}==
Result of an expression is printed by default:
<syntaxhighlight lang="bash">$ huginn -c '"Hello"'</syntaxhighlight>
Output:
<pre>"Hello"</pre>
Even with an explicit `print` function was used:
<syntaxhighlight lang="bash">$ huginn -c 'print("Hello\n")'</syntaxhighlight>
Output:
<pre>Hello
none</pre>
Unless the last expression ended with a semicolon:
<syntaxhighlight lang="bash">$ huginn -c 'print("Hello\n");'</syntaxhighlight>
Output:
<pre>Hello</pre>
 
=={{header|Icon}} and {{header|Unicon}}==
 
These examples work with posix shells.
 
<syntaxhighlight lang="icon">echo "procedure main();write(\"hello\");end" | icont - -x</syntaxhighlight>
 
<syntaxhighlight lang="unicon">echo "procedure main();write(\"hello world\");end" >hello.icn; unicon hello.icn -x</syntaxhighlight>
 
=={{Header|Insitux}}==
 
When Insitux has been already been installed system-wide (<code>npm i -g insitux</code>).
 
<pre>
$ npx ix -e "(+ 2 2)"
</pre>
 
{{out}}
 
<pre>
4
</pre>
 
=={{header|J}}==
<presyntaxhighlight lang="bash">$ jconsole -js "exit echo 'Hello'"
Hello</pre>
</syntaxhighlight>
 
Here, the (empty) result of <code>echo</code> is used as the exit code argument for <code>exit</code>. And, since it's empty, the the default exit code of 0 is what's actually used. The exit command here is used to prevent the default behavior of jconsole (which is to start the J [[wp:Command_shell|command shell]]) and to instead return to the OS command shell.
 
We could have instead used:
 
<syntaxhighlight lang="bash">$ :|jconsole -js "echo 'Hello'"
Hello
</syntaxhighlight>
 
for nearly identical behavior, but this issues J's command prompt before exiting. (But since J's command prompt is three space characters, this would be nearly invisible in many contexts, including here because the mediawiki implementation deletes those trailing spaces when rendering this page into html.)
That said, note that J interpreters can themselves be thought of as [[wp:Command_shell|command shells]].
 
=={{header|Java}}==
{{works with|bash}}
Works with bash on Unix/Linux/MacOSX/Windows+cygwin
These three lines work with Bourne Shell (or compatible) or C Shell (or compatible), or bash on Unix/Linux/MacOSX/Windows+cygwin
<PRE>
$ echo 'public class X{public static void main(String[] args){System.out.println("Hello Java!");}}'>X.java;javac X.java;java X
Hello Java!
</PRE>
 
<syntaxhighlight lang="bash">$ echo 'public class X{public static void main(String[]args){' \
Works with cmd.exe on Windows (tested on Microsoft Windows XP [Version 5.1.2600])
> 'System.out.println("Hello Java!");}}' >X.java
<PRE>
$ javac X.java && java X</syntaxhighlight>
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!
 
A user can also enter this as one (very long) line:
</PRE>
 
<syntaxhighlight lang="bash">$ echo 'public class X{public static void main(String[]args){System.out.println("Hello Java!");}}'>X.java;javac X.java&&java X</syntaxhighlight>
 
{{works with|MS-DOS}} Compatible Environments (such as [[wp:cmd.exe|cmd.exe]])
Works with cmd.exe on Windows (tested on Microsoft Windows XP [Version 5.1.2600])
<syntaxhighlight lang="cmd">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!</syntaxhighlight>
 
=={{header|JavaScript}}==
{{works with|SpiderMonkey}}
<presyntaxhighlight lang="bash">$ js -e 'print("hello")'
hello</presyntaxhighlight>
 
=={{header|jq}}==
<syntaxhighlight lang="sh">$ jq -M -n 1+1
2</syntaxhighlight>
 
=={{header|Julia}}==
<syntaxhighlight lang="julia">$ julia -e 'for x in ARGS; println(x); end' foo bar
foo
bar</syntaxhighlight>
 
=={{header|K}}==
{{works with|Kona}}
<syntaxhighlight lang="bash">$ k -e "\`0: \"hello\\n\""</syntaxhighlight>
 
=={{header|Kotlin}}==
The following one-liner works with GNOME Terminal on Ubuntu 14.04:
<pre>
echo 'fun main(args: Array<String>) = println("Hello Kotlin!")' >X.kt;kotlinc X.kt -include-runtime -d X.jar && java -jar X.jar
</pre>
{{out}}
<pre>
Hello Kotlin!
</pre>
 
=={{header|Lang}}==
This is an example for the Standard Lang implementation of Lang.
<syntaxhighlight lang="lang">
$ lang -e "fn.println(Hello World)"
</syntaxhighlight>
 
=={{header|langur}}==
=== Linux ===
<syntaxhighlight lang="langur">$ langur -e 'writeln "Are we reaching Fiji?"'
</syntaxhighlight>
 
=== Windows ===
<syntaxhighlight lang="langur">C:\> langur /e 'writeln "Are we reaching Fiji?"'
</syntaxhighlight>
 
{{out}}
<pre>Are we reaching Fiji?</pre>
 
=={{header|Lasso}}==
 
From stdin:
 
<syntaxhighlight lang="lasso">echo " 'The date and time is: ' + date " | lasso9 --</syntaxhighlight>
 
Or alternatively:
 
<syntaxhighlight lang="lasso">$ lasso9 -s " 'The date and time is: ' + date "</syntaxhighlight>
 
=={{header|Liberty BASIC}}==
<syntaxhighlight lang="lb">
echo print "hello">oneLiner.bas & liberty -r oneLiner.bas echo print "hello">oneLiner.bas & liberty -r oneLiner.bas
</syntaxhighlight>
 
=={{header|Lua}}==
<presyntaxhighlight lang="bash">lua -e 'print "Hello World!"'</presyntaxhighlight>
 
=={{header|MATLABMaple}}==
<syntaxhighlight lang="bash">maple -c'print(HELLO);' -cquit</syntaxhighlight>
The command line in MATLAB acts just like the "main()" function in Java. It's a state machine. Variables declared in the scope of the command line persist in that scope until cleared from memory. So any thing you could do in a script, you can execute by directly input the desired commands into the command line. This first example declares and initializes an array named "a", which is stored in the scope of the MATLAB environment. Then the next command computes the mean of the elements in "a".
 
=={{header|Mathematica}}/{{header|Wolfram Language}}==
Example:
<syntaxhighlight lang="mathematica">echo Print[2+2] > file & math.exe -script file</syntaxhighlight>
<lang MATLAB>>> a = [1 2 3];
>> mean(a)
 
=={{header|min}}==
ans =
<syntaxhighlight lang="min">min -e:"\"hi from min\" puts!"</syntaxhighlight>
 
=={{header|Nanoquery}}==
2</lang>
<syntaxhighlight lang="bash">nq -e "println \"Hello Nanoquery!\""</syntaxhighlight>
 
=={{header|NetLogo}}==
It is possible to declare a function in the command line thusly:
Commands can be entered into the NetLogo Command Center. NetLogo is white-space delimited. Variables can be defined with the LET command and used in the statement. The CC can be in various modes, such as Turtle mode, where entered commands are ran as if contained in an ASK TURTLES statement.
<lang MATLAB>>> helloWorld = @()disp('Hello World');
>> helloWorld()
Hello World</lang>
 
=== Observer Mode ===
<syntaxhighlight lang="netlogo">let x 15 ask turtles [ set xcor x set x x + 1 ]</syntaxhighlight>
 
=== Turtle Mode ===
=={{header|MUMPS}}==
<syntaxhighlight lang="netlogo">right random 90 forward 10</syntaxhighlight>
<pre>
USER>WRITE !,"Hello nice people"
 
=={{header|NetRexx}}==
Hello, nice people
{{works with|UNIX Shell}}
USER>DO HAPPY^ROSETTA(3)
Create a temporary file, execute the file via the NetRexx interpreter then delete the temporary file and any files generated via the translation. (i.e. Java class files etc.)
<syntaxhighlight lang="bash">
The first 3 happy numbers are:
$ TNRX=`mktemp T_XXXXXXXXXXXX` && test ! -e $TNRX.* && (echo 'say "Goodbye, World!"' >$TNRX; nrc -exec $TNRX; rm $TNRX $TNRX.*; unset TNRX)
1
</syntaxhighlight>
7
 
10
'''Output:'''
<pre>
NetRexx portable processor, version NetRexx 3.01, build 40-20120823-0156
Copyright (c) RexxLA, 2011,2012. All rights reserved.
Parts Copyright (c) IBM Corporation, 1995,2008.
Program T_dO7RQs5HPElq
===== Exec: T_dO7RQs5HPElq =====
Goodbye, World!
Processing of 'T_dO7RQs5HPElq' complete
</pre>
 
=={{header|NewLISP}}==
<syntaxhighlight lang="newlisp">newlisp -e "\"Hello\"
->"Hello"</syntaxhighlight>
 
=={{header|Nim}}==
The following works on any Linux system. With some minor changes, it should work on other systems too.
<pre>$ echo 'for i in 0..10: echo "Hello World"[0..i]' >/tmp/oneliner.nim; nim r oneliner
H
He
Hel
Hell
Hello
Hello
Hello W
Hello Wo
Hello Wor
Hello Worl
Hello World</pre>
 
=={{header|Objeck}}==
{{works with|UNIX Shell}}
<presyntaxhighlight lang="bash">./obc -run '"Hello"->PrintLine();' -dest hello.obe ; ./obr hello.obe</presyntaxhighlight>
 
=={{header|OCaml}}==
<presyntaxhighlight lang="bash">$ ocaml <(echo 'print_endline "Hello"')
Hello</presyntaxhighlight>
{{works with|OCaml|4.00+}}
<syntaxhighlight lang="bash">$ echo 'print_endline "Hello"' | ocaml -stdin
Hello</syntaxhighlight>
 
=={{header|OzOctave}}==
<syntaxhighlight lang="matlab">$ octave --eval 'printf("Hello World, it is %s!\n",datestr(now));'
This is difficult to do in Oz because the compiler/interpreter always wants the source code in a file and does not read from stdin. We can do somethings like this on Unix-like systems:
Hello World, it is 28-Aug-2013 17:53:47!</syntaxhighlight>
 
=={{header|Oforth}}==
 
<syntaxhighlight lang="oforth">oforth --P"1000 seq map(#sqrt) sum print"</syntaxhighlight>
 
{{out}}
<pre>
21097.4558874807
echo >tmp.oz "{System.show hello}"; ozc -l System -e tmp.oz
hello
</pre>
 
=={{header|ooRexx}}==
<syntaxhighlight lang="bash">
rexx -e "say 'Goodbye, world.'"
</syntaxhighlight>
 
=={{header|Oz}}==
This is difficult to do in Oz because the compiler/interpreter always wants the source code in a file and does not read from stdin. We can do somethings like this on Unix-like systems:
<syntaxhighlight lang="bash">echo >tmp.oz "{System.show hello}"; ozc -l System -e tmp.oz
hello</syntaxhighlight>
 
With <code>-l System</code> we make the System module available so that we can print something.
 
=={{header|PARI/GP}}==
<syntaxhighlight lang="bash">echo "print(Pi)" | gp -q</syntaxhighlight>
<lang parigp>system("ls")</lang>
 
=={{header|Pascal}}==
''See [[#Free Pascal|Free Pascal]]''
 
=={{header|Perl}}==
<presyntaxhighlight lang="bash">$ perl -e 'print "Hello\n"'
Hello</presyntaxhighlight>
 
More information about the many ways of invoking perl can be found in [http://perldoc.perl.org/perlrun.html perlrun].
=={{header|Perl 6}}==
{{works with|Rakudo|#22 "Thousand Oaks"}}
 
=={{header|Phix}}==
<pre>$ perl6 -e 'say "Hello, world!"'
<!--(notonline)-->
Hello, world!</pre>
Command line option -e added for 0.8.1. Outer quotes only rqd if snippet contains spaces, otherwise ignored. <br>
Most one-liners will probably start with '?' since eg "1+2" gives a compilation error.
<pre>
C:\Program Files (x86)\Phix>p -e ?357+452
809
C:\Program Files (x86)\Phix>p -e "?357+452"
809
</pre>
 
=={{header|PHP}}==
assuming you have the PHP CLI (command-line interface) installed, not just the web server plugin
<presyntaxhighlight lang="bash">$ php -r 'echo "Hello\n";'
Hello</presyntaxhighlight>
 
=={{header|PicoLisp}}==
<langsyntaxhighlight PicoLisplang="picolisp">$ picolisp -'prinl "Hello world!"' -bye
Hello world!</langsyntaxhighlight>
 
=={{header|Pike}}==
<langsyntaxhighlight pikelang="bash">$ pike -e 'write("Hello\n");'
Hello</langsyntaxhighlight>
 
=={{header|PowerShell}}==
<presyntaxhighlight lang="cmd">> powershell -Command "Write-Host 'Hello'"
Hello</presyntaxhighlight>
 
=={{header|Processing}}==
The command-line tool processing-java takes a sketch directory (not a file) and so a simple program cannot be piped in from the shell using process substitution. However, a long shell one-liner may write a sketch file to disk, then run it, so long as the folder name and the PDE file name match, e.g. /Tmp/Tmp.pde
 
In bash:
<syntaxhighlight lang="processing">mkdir -p Tmp; echo "println(\"hello world\");" > Tmp/Tmp.pde; processing-java --sketch="`pwd`/Tmp" --run</syntaxhighlight>
 
{{out}}
<pre>
hello world
</pre>
 
=={{header|Prolog}}==
===Command-Line Options===
<syntaxhighlight lang="prolog">$ swipl -g "writeln('hello world')." -t 'halt.'
hello world
$</syntaxhighlight>
<syntaxhighlight lang="prolog">$ gprolog --init-goal "write('goodbye'),nl,halt"
goodbye
$</syntaxhighlight>
<syntaxhighlight lang="prolog">$ yap -q -g "current_prolog_flag(dialect, D), writeln(D), halt"
yap</syntaxhighlight>
=== <<< ===
<syntaxhighlight lang="prolog">$ swipl -q <<< "current_prolog_flag(dialect,D), writeln(D), halt."
swi
 
$ yap -q <<< "current_prolog_flag(dialect,D), writeln(D), halt."
yap</syntaxhighlight>
=== Pipe ===
<syntaxhighlight lang="prolog">$ echo "current_prolog_flag(dialect,D), writeln(D), halt." | swipl -q
swi
 
$ echo "current_prolog_flag(dialect,D), writeln(D), halt." | yap -q
yap</syntaxhighlight>
 
=={{header|PureBasic}}==
Runs on Linux with(thanks to) bash. Path variables must be set as decribed in INSTALL.
<presyntaxhighlight lang="bash">$ echo 'messagerequester("Greetings","hello")' > "dib.pb" && ./pbcompiler dib.pb -e "dib" && ./dib</presyntaxhighlight>
 
=={{header|Python}}==
===Prints "Hello"===
<presyntaxhighlight lang="bash">$ python -c 'print "Hello"'
Hello</presyntaxhighlight>
 
===Web server with CGI===
The python CGIHTTPServer module is also an [[Executable library|executable library]] that performs as a web server with CGI. to start enter:
<presyntaxhighlight lang="bash">python -m CGIHTTPServer</presyntaxhighlight>
It returns with:
<pre>Serving HTTP on 0.0.0.0 port 8000 ...</pre>
 
=={{header|RQuackery}}==
 
<syntaxhighlight lang="bash">$ QUACK=$(mktemp); echo "say 'hello'" > $QUACK; quackery $QUACK; rm $QUACK
<pre>$ echo 'cat("Hello\n")' | R --slave
hello</syntaxhighlight>
Hello
 
</pre>
===Via Python 3===
 
As Quackery is implemented as a Python 3 function, assuming that quackery.py is in the module search path:
 
<syntaxhighlight lang="bash">$ python3 -c 'import quackery ; quackery.quackery(r""" say '\''hello'\'' cr """)'
hello</syntaxhighlight>
 
=={{header|R}}==
<syntaxhighlight lang="bash">$ echo 'cat("Hello\n")' | R --slave
Hello</syntaxhighlight>
 
Alternatively, using the Rscript front-end,
<syntaxhighlight lang="bash">$ Rscript -e 'cat("Hello\n")'
Hello</syntaxhighlight>
 
=={{header|Racket}}==
<pre>$ Rscript -e 'cat("Hello\n")'
<syntaxhighlight lang="bash">$ racket -e "(displayln \"Hello World\")"
Hello
Hello World</syntaxhighlight>
</pre>
 
=={{header|Raku}}==
(formerly Perl 6)
{{works with|Rakudo|#22 "Thousand Oaks"}}
 
<syntaxhighlight lang="bash">$ raku -e 'say "Hello, world!"'
Hello, world!</syntaxhighlight>
 
=={{header|REBOL}}==
<presyntaxhighlight lang="bash">rebview -vswq --do "print {Hello!} quit" </presyntaxhighlight>
 
Output:
 
<pre>Hello!</pre>
 
=={{header|Retro}}==
<langsyntaxhighlight Retrolang="retro">echo '"hello\n"'hello putss:put nl bye' | ./retro</langsyntaxhighlight>
 
=={{header|REXX}}==
Note: &nbsp; Regina REXX is the only version of REXX that supports this type of behavior &nbsp; (taking it's input from a console stream).
To execute a REXX program depends largely on the operating system.
<syntaxhighlight lang="rexx">
╔══════════════════════════════════════════════╗
║ ║
║ from the MS Window command line (cmd.exe) ║
║ ║
╚══════════════════════════════════════════════╝
 
Where REXX was originally developed ([[wp:VM (operating system)|VM/CMS]]), there was native support for EXECs (which REXX is a type of); the REXX program had a filetype of 'EXEC' and all one needed to do to invoke it was to just enter its filename.
 
echo do j=10 by 20 for 4; say right('hello',j); end | regina</syntaxhighlight>
A REXX program may be named (say):
'''output''' &nbsp; when entering the (above) from the (DOS) command line:
<lang rexx>SOMESUCH EXEC A1</lang>
<pre>
hello
hello
hello
hello
</pre>
 
=={{header|Ring}}==
''SOMESUCH'' is the filename
<syntaxhighlight lang="ring">
''EXEC'' is the filetype (the file extension)
see "Hello World!" + nl
''A1'' is the filemode (A would be like a harddrive letter)
</syntaxhighlight>
Output:
<pre>
Hello World!
</pre>
 
=={{header|RPL}}==
To execute it, enter:
RPL command-line interpreter allows to pass several instructions and values in one line, provided there is no program branch instruction among them. It is nevertheless possible to have a program structure in the line by bracketing it with <code>≪ ≫</code>, which means "this is an unnamed program". Adding the word <code>EVAL</code> at the end will execute the code, otherwise it would stay at level 1 of the stack.
<lang rexx>SOMESUCH ...optionalParameters...</lang>
" World" "Hello" SWAP +
or
<lang rexx>EXEC SOMESUCH ...optionalParameters...</lang>
 
≪ " World" "Hello" SWAP + ≫ EVAL
In [[wp:MVS|MVS]]/[[wp:Time Sharing Option|TSO]], 'SOMESUCH' would be placed in an appropiate PDS ([[wp:Data set (IBM mainframe)#Partitioned datasets|partitioned dataset]]) library, and the following command could be issued:
This less trivial one-liner example calculates S(5), where S(n) is a Machin-like formula :
<lang rexx>SOMESUCH</lang>
≪ 0 0 5 '''FOR''' k 2 k * 1 + → n ≪ -1 k ^ n / 4 5 n ^ / 239 n ^ INV - * + ≫ '''NEXT''' 4 * ≫ EVAL
{{out}}
<pre>
3: "Hello world"
2: "Hello world"
1: 3.14159265262
</pre>
 
=={{header|Ruby}}==
In CMS (VM), TSO (MVS), and [[OS/2]] (among others in the IBM family), the REXX interpretor is built in the operating system.
From [[Unix]]:
<syntaxhighlight lang="bash">$ ruby -e 'puts "Hello"'
Hello</syntaxhighlight>
 
{{works with|JRuby}}
In [[DOS]] (under [[Windows]] or not), most REXX interpretors assume a REXX program has a particular file extension (or one of serveral extensions, 'REX', 'REXX', 'CMD' being the most common), and to invoke a REXX interpretor to execute (interpret) a REXX program, the name of the REXX interpreter is issued followed by the REXX program name (and followed by any optional parameters).
<syntaxhighlight lang="bash">$ jruby -e 'puts "Hello from JRuby"'
Hello from JRuby</syntaxhighlight>
 
{{works with|Rubinius}}
Alternatively, in the [[Windows NT]] family of operating systems (which includes 2000, XP, Vista, 7, and up), a program can be associated with a file's extension, so when the following is issued:
<syntaxhighlight lang="bash">$ rbx -e 'puts "Hello from Rubinius"'
<lang rexx>SOMESUCH</lang>
Hello from Rubinius</syntaxhighlight>
Windows (or DOS) would look in the usual places (usually starting in the current directory, and including, but not limited to the PATH, it would find SOMESUCH.REX (for instance), and note that files with such file extension should be executed with the appropriate program, for example REXX.EXE, REGINA.EXE, or R4.EXE (just to name a few examples, but only one could be specified), which itself, could be in the PATH or be specified as a specific file such as <code>C:\LANGUAGES\REXX\REXX.EXE</code> (just an example).
 
=={{header|RubyRun BASIC}}==
<syntaxhighlight lang="bash">print shell$("echo hello world")</syntaxhighlight>
<pre>$ ruby -e 'puts "Hello"'
 
Hello</pre>
=={{header|Rust}}==
The following code leaves the file <tt>rust_out</tt> in the current directory (it does not
delete it to avoid to call another shell/system dependent command/program). The
''current directory'' is not specified by <tt>./</tt> in every system...
<syntaxhighlight lang="bash">$ echo 'fn main(){println!("Hello!")}' | rustc -;./rust_out</syntaxhighlight>
 
=={{header|S-lang}}==
<syntaxhighlight lang="s-lang">slsh -e 'print("Hello, World")'</syntaxhighlight>
 
Or, in MSW cmd.exe:
 
<syntaxhighlight lang="s-lang">slsh -e "print(\"Hello, World\")"</syntaxhighlight>
 
Note that print() is included w/slsh, but is not part of S-Lang itself.
 
=={{header|Scala}}==
{{libheader|Scala}}
<pre>C:\>scala -e "println(\"Hello\")"
<syntaxhighlight lang="cmd">C:\>scala -e "println(\"Hello\")"
Hello</pre>
Hello</syntaxhighlight>
The escaping of quotes is required by Windows. On Unix, one could just use single quotes around the code. In either case, any required libraries should have their JAR files pointed at by the environment variable CLASSPATH.
<syntaxhighlight lang="cmd">
PS C:\> scala -e 'println(\"Hello\")'
Hello</syntaxhighlight>
 
The escaping of quotes is required by Windows.
On Unix and shown in the example on [[PowerShell|Windows PowerShell]],
one could just use single quotes around the code.
 
=={{header|Scheme}}==
{{works with|Guile}}
<langsyntaxhighlight lang="scheme">guile -c '(display "Hello, world!\n")'</langsyntaxhighlight>
 
=={{header|sed}}==
The first non-option argument is interpreted as the script.
<syntaxhighlight lang="sh">$ sed q /proc/meminfo</syntaxhighlight>
Alternatively, scripts can be passed via the <code>-e</code> option.
<syntaxhighlight lang="sh">$ sed -e 's/[[:space:]]*$//' -e '/./!d' file.txt</syntaxhighlight>
 
=={{header|Shiny}}==
<langsyntaxhighlight lang="shiny">shiny -e "say 'hi'" </langsyntaxhighlight>
 
=={{header|Sidef}}==
<syntaxhighlight lang="ruby">% sidef -E "say 'hello'"</syntaxhighlight>
 
=={{header|Slate}}==
<langsyntaxhighlight lang="slate">./slate --eval "[inform: 'hello'] ensure: [exit: 0].".</langsyntaxhighlight>
 
=={{header|SNOBOL4}}==
Portable version
<langsyntaxhighlight lang="snobol">echo 'a output = "Hello, World!";end' | snobol4 -b</langsyntaxhighlight>
 
Bash version
<langsyntaxhighlight lang="snobol">snobol4 -b <<<'a output = "Hello, World!";end'</langsyntaxhighlight>
 
 
=={{header|Tcl}}==
This is an area where Tcl is lacking, though when shell one-liners are required a construct like this is typically used:
<presyntaxhighlight lang="bash">$ echo 'puts Hello' | tclsh
Hello</presyntaxhighlight>
(This apparent weakness is purposeful; it leaves a larger fraction of the space of possible arguments open to use by the script being executed.)
 
=={{header|TXR}}==
 
<syntaxhighlight lang="bash">$ echo 123-456-7890 | txr -c '@a-@b-@c' -
Invoking from the shell, a multi-line TXR query is passed using -c as a single argument. It invokes the shell command using bang notation in <code>@(next)</code>, collect its output and dumps the bindings:
a="123"
b="456"
c="7890"
</syntaxhighlight>
 
Most useful txr queries consist of multiple lines, and the line structure is important. Multi-liners can be passed via <code>-c</code> easily, but there is no provision in the syntax that would allow multi-liners to be actually written as one physical line. There are opposite provisions for splitting long logical lines into multiple physical lines.
<pre>$ txr -c '@(next `!for x in 0 1 2 3 4; do echo $x; done`)
@(collect)
@X
@(end)
'
X[0]="0"
X[1]="1"
X[2]="2"
X[3]="3"
X[4]="4"</pre>
 
The <code>-e</code> (evaluate) and <code>-p</code> (evaluate and print) options provide shell one-liner access to
{{works with|bash}}
TXR Lisp:
 
<syntaxhighlight lang="bash">$ txr -p '(+ 2 2)'
If we eval the above command back into the shell, we create an array (if the shell supports array syntax).
4</syntaxhighlight>
 
<syntaxhighlight lang="bash">$ txr -e '(mkdir "foo" #o777)'
<pre>$ eval $(txr -c '@(next `!for x in 0 1 2 3 4; do echo $x; done`)
$ ls -ld foo
@(collect)
drwxrwxr-x 2 kaz kaz 4096 Mar 4 23:36 foo</syntaxhighlight>
@X
@(end)
')
$ echo ${X[*]}
0 1 2 3 4</pre>
=={{header|UNIX Shell}}==
 
=={{header|UNIX Shell}}==
Explicit call of the shell, passing the shell command via the <code>-c</code> option:
<syntaxhighlight lang="bash">$ sh -c ls</syntaxhighlight>
 
<langsyntaxhighlight lang="bash">$ sh -c ls"echo hello"</langsyntaxhighlight>
 
<lang bash>$ sh -c "echo hello"</lang>
 
To invoke a specific shell like [[Bash]], [[Korn Shell]] or [[Z Shell]]:
 
<langsyntaxhighlight lang="bash">$ bash -c 'paste <(echo 1) <(echo 2)'
$ ksh -c 'let i=3+4; print $i'
$ zsh -c 'if [[ 5 -lt 6 ]] { echo ok };'</langsyntaxhighlight>
 
Shell scripts almost never use <code>sh -c</code>, because there are various implicit ways whereby the shell command language evaluates a command in a subshell:
 
<langsyntaxhighlight lang="bash">$ VAR=`echo hello` # obsolescent backtick notation
$ VAR=$(echo hello) # modern POSIX notation
$ (echo hello) # execute in another shell process, not in this one</langsyntaxhighlight>
 
There are more details about <code>`echo hello`</code> and <code>$(echo hello)</code> at [[Execute a system command#UNIX Shell]].
Line 434 ⟶ 894:
Run a C shell command from any shell:
 
<presyntaxhighlight lang="bash">$ csh -fc 'if (5 < 6) echo ok'</presyntaxhighlight>
 
==={{header|es}}===
Run a command, in extensible shell, from any shell:
 
<syntaxhighlight lang="bash">$ es -c 'if {test 5 -lt 6} {echo ok}'</syntaxhighlight>
 
=={{header|Ursala}}==
The command to execute the Ursala compiler is fun. An expression supplied as a parameter to the --main option is compiled and evaluated. If the expression evaluates to a list of character strings, it can be displayed on standard output with --show. If it's some other type, it can be formatted for display by --cast <type expression>,
The command to execute the Ursala compiler is fun. An expression
supplied as a parameter to the --main option is compiled and evaluated. If
the expression evaluates to a list of character strings, it can
be displayed on standard output with --show. If it's some other
type, it can be formatted for display by --cast <type expression>,
 
<presyntaxhighlight lang="bash">$ fun --main=-[hello]- --show
hello
$ fun --main="power/2 32" --cast %n
4294967296
$ fun --m="..mp2str mpfr..pi 120" --c %s
'3.1415926535897932384626433832795028847E+00'</presyntaxhighlight>
 
=={{header|Vedit macro language}}==
{{omit from|Ada}}
The following DOS command starts Vedit and displays a message.
{{omit from|Go}}
When the user presses any key, Vedit exits.
{{Omit From|Java}}
<syntaxhighlight lang="cmd">vpw -c'Get_Key("Hello!") exit'</syntaxhighlight>
 
=={{header|Wart}}==
<syntaxhighlight lang="bash">echo "prn 34" |wart</syntaxhighlight>
 
=={{header|Wren}}==
<syntaxhighlight lang="bash">echo 'System.print("Hello from Wren!")' > tmp.wren; wren tmp.wren</syntaxhighlight>
 
{{out}}
<pre>
Hello from Wren!
</pre>
 
=={{header|zkl}}==
With a unix like shell, just pipe the program into the REPL. Kinda greasy and noisy. To shut it up, send stdout to /dev/null
<syntaxhighlight lang="bash">echo 'println("Hello World ",5+6)' | zkl</syntaxhighlight>
{{out}}
<pre>
zkl 1.12.9, released 2014-05-01
Hello World 11
Hello World 11
</pre>
{{omit from|6502 Assembly|Anything can be a one-liner if you JSR to it.}}
{{omit from|68000 Assembly}}
{{omit from|Z80 Assembly}}
{{omit from|8086 Assembly}}
{{omit from|x86 Assembly}}
{{omit from|ARM Assembly}}
{{omit from|AutoHotkey|No interactive shell}}
{{omit from|C++}}
{{omit from|Java}}
{{omit from|Maxima}}
{{omit from|Modula-3}}
{{omit from|SAS}}
{{omit from|Stata}}
{{omit from|TI-83 BASIC}}
{{omit from|TI-89 BASIC}} <!-- Does not have an external OS/command processor. -->
Anonymous user