Last active
October 16, 2022 13:10
-
-
Save for2ando/b5b02a80ae8f3d45dd4ecfcceaa9b3e1 to your computer and use it in GitHub Desktop.
A wrapper for non-BSD install command to behave as a BSD's install command when using -v option.
This file contains hidden or 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 | |
## Let non-BSD install command to behave as a BSD's install command | |
## when using -v option. | |
verbosep=false | |
case "$1" in | |
-*v*) verbosep=true;; | |
esac | |
$verbosep && { | |
target="$3/$(basename $2)" | |
stamp_old="$(ls -l $target)" | |
} | |
install "$@" && $verbosep && { | |
stamp_new="$(ls -l $target)" | |
test "$stamp_old" != "$stamp_new" && echo install "$@" || true | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment