Skip to content

Instantly share code, notes, and snippets.

@error9900
Created April 14, 2025 20:20
Show Gist options
  • Save error9900/09ff4e0f0e5e77dfa8652df88853b3db to your computer and use it in GitHub Desktop.
Save error9900/09ff4e0f0e5e77dfa8652df88853b3db to your computer and use it in GitHub Desktop.
Example of using a function inside a /bin/sh script to display a command followed by the output of the command
#!/bin/sh
run_and_show() {
echo "Running: $*"
"$@"
}
run_and_show df -h
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment