ls (coreutils), -500
Create an empty file named 1
and save it in the current directory.
Usage: In the terminal, type ls 1
This usage is analogous to how you run a python script by typing in a terminal python 1.py
or running a perl script by typing perl 1.pl
, so I think this should qualify.
Edit: since someone in the comments doesn't seem to get what this answer means, here's an explanation:
First, an empty file is created and is saved in the current directory, with the name 1
.
Next, in a terminal that is at the current directory, run ls 1
. Since I suspect he doesn't know what ls
is, here is a copy from the ls
man page:
NAME
ls - list directory contents
SYNOPSIS
ls [OPTION]... [FILE]...
DESCRIPTION
List information about the FILEs (the current directory by default).
Sort entries alphabetically if none of -cftuvSUX nor --sort is speci‐
fied.
Output: As long as you are in the directory where your "script" is located, it will always output 1
.
Now, some may argue that this answer isn't really valid because it is not really a "script" and ls
isn't exactly a programming or scripting language. I provide the counter-argument that this "script" is invoked in the same fashion as the popular scripting languages python and perl, that is, by calling the interpreter executable, followed by the file name. I argue that in this answer, I call the interpreter executable, namely ls
, then provide the script name, 1
. Since they are invoked in the same fashion, I argue that the should be treated the same, and this answer should be valid.
Hope this clears things up. I'm just trying to come up with a "smart" way to get the -500 bonus - I mean, if no one tries that, this question would become meaningless (since it is even more trivial than printing "Hello World").