The character count includes the newline in the source (because it is produced in the output).
If you've not heard of $BASH_COMMAND before, the manual says:
BASH_COMMAND
The command currently being executed or about to be
executed, unless the shell is executing a command as the result of a
trap, in which case it is the command executing at the time of the
trap.
1
grand central
On
I feel like:
cat $0
should work but they dont accept it
1
mrmtonio
On
I think I just stumbled on a bash quine, which may be the shortest non-empty one, though cheating a little bit:
you write a file like this:
#!/bin/cat
do chmod a+x on the file
then do ./file
the output will produce the contents of the file itself lol
0
Ezlanding
On
18 Character Bash Quine
history|tail -c18
Note: this is a cheating quine (like "$BASH_COMMAND") because it inspects its own source code. It uses history to read in the bash history from RAM then grabs the last 18 characters
19 characters:
The character count includes the newline in the source (because it is produced in the output).
If you've not heard of
$BASH_COMMANDbefore, the manual says: