“Simple” Bash Hello World

Here is a quick-and-simple hello-world program for bash on Linux :)

#!/bin/sh
export t=$(mktemp) && printf 'global e\ne:\nmov rdi,0\nmov rsi,m\nmov rdx,l\nmov rax,1\nsyscall\nxor rdi,rdi\nmov rax,60\nsyscall\nm:db"Hello, world!",10\nl equ $-m\n' > $t && nasm -D e=_start -f elf64 $t -o "$t"0 && ld "$t"0 -o $t && $t

Simply put in inside a file (say, hello_world.sh), mark said file executable (chmod +x hello_world.sh), and run it to see the magic (./hello_world.sh)!

Inspired by the first few minutes of the following video: