Using find command in bash script

Welcome to bash. It’s an old, dark and mysterious thing, capable of great magic. 🙂 The option you’re asking about is for the find command though, not for bash. From your command line, you can man find to see the options. The one you’re looking for is -o for “or”: list=”$(find /home/user/Desktop -name ‘*.bmp’ -o … Read more

curl 302 redirect not working (command line)

You need to supply the -L or –location option in order to enable curl to follow HTTP redirects. Quoting from man curl: -L, –location (HTTP/HTTPS) If the server reports that the requested page has moved to a different location (indicated with a Location: header and a 3XX response code), this option will make curl redo … Read more

How to expand shell variables in a text file?

This question has been asked in another thread, and this is the best answer IMO: export LOG_FILE_PATH=/expanded/path/of/the/log/file/../logfile.log cat Text_File.msh | envsubst > Text_File_expanded.msh if on Mac, install gettext first: brew install gettext see: Forcing bash to expand variables in a string loaded from a file

How do I check if my local docker image is outdated, without pushing from somewhere else?

You can query the registry API for the image digest and compare it to that of what you’ve pulled. $ cat digest-v2.sh #!/bin/sh ref=”${1:-library/ubuntu:latest}” repo=”${ref%:*}” tag=”${ref##*:}” acceptM=”application/vnd.docker.distribution.manifest.v2+json” acceptML=”application/vnd.docker.distribution.manifest.list.v2+json” token=$(curl -s “https://auth.docker.io/token?service=registry.docker.io&scope=repository:${repo}:pull” \ | jq -r ‘.token’) curl -H “Accept: ${acceptM}” \ -H “Accept: ${acceptML}” \ -H “Authorization: Bearer $token” \ -I -s “https://registry-1.docker.io/v2/${repo}/manifests/${tag}” $ ./digest-v2.sh … Read more

techhipbettruvabetnorabahisbahis forumueduedusedueduseduseduseduedueduedus