Last active
July 3, 2024 14:46
-
-
Save mataha/f6821c619d653d1194660d36d0a01415 to your computer and use it in GitHub Desktop.
curl shell test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:<<"#!/bin/sh" | |
::: curl -fsSL "..." | sh | |
::: | cmd /d/q/k echo off | |
@if not "%=^%=" == "%=%=" (set \p=^%<nul) else (set \p=%%<nul) | |
set last= | |
for /f delims^= %\p%l in ('^"doskey /history^"') do (set "last=%\p%~l") | |
if defined last (echo(Last command: "%last%") | |
echo CMDCMDLINE: '%CMDCMDLINE%' | |
exit 0 | |
#!/bin/sh | |
# shellcheck shell=dash | |
say() { | |
printf '%s\n' "${*}" | |
} | |
die() { | |
say "error: bootstrap: ${*}" | |
exit 1 | |
} >&2 | |
main() { | |
say "Last command: $(history | tail -n1 | sed 's/[0-9]* //')" | |
} | |
main "${@}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment