Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

Commonmark migration
Source Link

##AWK, 39 bytes #!/bin/awk -f BEGIN{"poweroff"|getline}

AWK, 39 bytes

#!/bin/awk -f
BEGIN{"poweroff"|getline}

Assumes running on Linux and that AWK is located at /bin/awk and that the poweroff command is in the users path.

Since it uses the BEGIN block, no input is necessary. It simply pipes the output of the poweroff command into getline which it precedes to ignore.

Should work for Windows users provided they are in an environment similar to Cygwin.

##AWK, 39 bytes #!/bin/awk -f BEGIN{"poweroff"|getline}

Assumes running on Linux and that AWK is located at /bin/awk and that the poweroff command is in the users path.

Since it uses the BEGIN block, no input is necessary. It simply pipes the output of the poweroff command into getline which it precedes to ignore.

Should work for Windows users provided they are in an environment similar to Cygwin.

AWK, 39 bytes

#!/bin/awk -f
BEGIN{"poweroff"|getline}

Assumes running on Linux and that AWK is located at /bin/awk and that the poweroff command is in the users path.

Since it uses the BEGIN block, no input is necessary. It simply pipes the output of the poweroff command into getline which it precedes to ignore.

Should work for Windows users provided they are in an environment similar to Cygwin.

Source Link
Robert Benson
  • 1.8k
  • 11
  • 13

##AWK, 39 bytes #!/bin/awk -f BEGIN{"poweroff"|getline}

Assumes running on Linux and that AWK is located at /bin/awk and that the poweroff command is in the users path.

Since it uses the BEGIN block, no input is necessary. It simply pipes the output of the poweroff command into getline which it precedes to ignore.

Should work for Windows users provided they are in an environment similar to Cygwin.

AltStyle によって変換されたページ (->オリジナル) /