Last active
May 24, 2022 10:06
-
-
Save marc0der/6015948 to your computer and use it in GitHub Desktop.
Higher order function in bash!
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/bash | |
function printit { | |
echo "This is from an embedded function: $1" | |
} | |
function printthat { | |
echo "This is the first line." | |
$1 $2 | |
echo "This is the third line." | |
} | |
printthat printit 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
yeah, that's cool!
bash can do a lot worse though. :)
I've seen code that evals code that evals code in a build script -- that wasn't cool anymore.