Category: shell scripts
-
Unix, Linux: how to do a proper and secure file transfer in a cronjob
I got advised to do sftp with an empty passphrase. I got that working. Was pretty straight forward. But is there a better way? With a non-empty passphrase? But how to deal with that passphrase? https://en.wikipedia.org/wiki/ssh-agent https://linuxhandbook.com/transfer-files-ssh/ https://www.tecmint.com/ssh-passwordless-login-using-ssh-keygen-in-5-easy-steps/ my buzzword web search: ssh file transfer best practice I do my ordinary SSH handling with an…
-
“ShellCheck finds bugs in your shell scripts” – shell script analysis tool
https://www.ShellCheck.net/ https://github.com/koalaman/shellcheck “You can cabal, apt, dnf, pkg or brew install it locally right now” “already packaged for your distro or package manager” “written in Haskell, if you’re into that sort of thing”
-
GNU wdiff — front end to GNU diff — word differences
https://directory.fsf.org/wiki/Wdiff Compares two files on a word per word basis, finding the word deleted or added from the first file to make the second. A word is defined as anything between whitespace. It works by creating two temporary files, one word per line, and the executes ‘diff’ on these fields. It collects the ‘diff’ output…
-
O’Reilly Media book: Classic Shell Scripting
http://shop.oreilly.com/product/9780596005955.do https://resources.oreilly.com/examples/9780596005955/ (a Git repository) http://examples.oreilly.com/9780596005955/ nice scripts shown there and available in the sample code: pathfind.sh – rather similar to my own find_file_on_PATH.sh show-identical-files.sh – rather similar to my own group_by_content.sh – but has a problem with “md5sum” – I fixed that puser.sh …