Last active
September 23, 2022 09:13
-
-
Save baamenabar/7411d3774829590040d9 to your computer and use it in GitHub Desktop.
in shell bash: Read a file, get the md5 checksum, save it in a variable, make a copy of the file with the hash,
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 | |
# http://stackoverflow.com/questions/3679296/only-get-hash-value-using-md5sum-without-filename | |
md5HASH=($(md5sum www/app/js/bundle.js| cut -d ' ' -f 1)) | |
cp www/app/js/bundle.js www/app/js/bundle-$md5HASH.js; | |
# store in variable in file | |
echo "<?php define('HASH_EXT', '$md5HASH'); ?>" > www/app/inc/hash-bundle.php; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment