mingw-get
ist verfügbar bei
sourceforge.net/projects/mingw/files/Installer/mingw-get
Nachdem Sie diesen installiert haben, laufen Sie
mingw-get install msys-coreutils
Ich habe viel unter git-bash
Windows 7 verwendet. Ich finde, es ist ein Wrapper von MinGW. Es hat md5sum, aber nicht sha1sum . Ich würde gerne installieren sha1sum
, aber ich weiß nicht wie.
Wenn ich es versuche mingw-get
, sagt es "Befehl nicht gefunden"
Als ich versuchte, mingw-get
von SourceForge herunterzuladen, fand ich nur ein Installationsprogramm für das gesamte MinGW-Programm, aber nicht für mingw-get
.
Wie installiere ich entweder get sha1sum
oder get mingw-get
?
mingw-get
ist verfügbar bei
sourceforge.net/projects/mingw/files/Installer/mingw-get
Nachdem Sie diesen installiert haben, laufen Sie
mingw-get install msys-coreutils
Ich löste das Problem für mich, indem ich eine Shell-Funktion hinzufügte, die das mitgelieferte openssl verwendet, um den am häufigsten verwendeten Teil von sha1sum zu ersetzen.
function openssl_sha1sum() { local i nf=0 binary= text=true local -a files # parse for -b/-t mode output arguments for (( i=1; i <= $#; i++ )); do case "${!i}" in (-t|--text) text=true binary= ;; (-b|--binary) binary=true text= ;; (-|-[cw]|--help|--version|--status|--check|--warn) ;; (*) let 'nf++' files[$nf]="${!i}" ;; esac done # execute the appropriate command and reformat the output if [ $nf -eq 0 ]; then local binfmt='s/$/ *-/;' txtfmt='s/$/ -/;' if [ -n "$binary" ]; then fmt=$binfmt else fmt=$txtfmt fi openssl dgst -sha1 -hex | sed -e "$fmt" else local commonfmt='s/^[A-Z0-9]\+(\(.*\))= \([0-9a-fA-F]\+\)$/\2' local binfmt="$commonfmt "'*\1/;' txtfmt="$commonfmt "'\1/;' if [ -n "$binary" ]; then fmt=$binfmt else fmt=$txtfmt fi openssl dgst -sha1 -hex "$" | sed -e "$fmt" fi } if ! type -p sha1sum &>/dev/null; then function sha1sum() { openssl_sha1sum "$@"; } fi