aws_profile_generate_direnvs.sh - generates subdirectories containing the config.ini and .envrc for every AWS profile found in the given file or $AWS_CONFIG_FILE or ~/.aws/config. Useful to take a large generated AWS config.ini from aws_sso_configs.sh and then split it into subdirectori...
The idea here is thatfindwill be responsible for your filenames, and will run each of the tools to do (1) the analysis and (2) the modification. Note that thegrephere is probably redundant, assedwill simply make no changes to files where it doesn't find the search string. This saves...
grep'*foo*'file# Globs in regex contextsfind . -execfoo {} && bar {} \;# Prematurely terminated find -execsudoecho'Var=42'> /etc/profile# Redirecting sudotime --format=%s sleep 10# Passing time(1) flags to time builtinwhilereadh;dossh"$h"uptime# Commands eating while loop inputali...
file filenameExample:$ file index.html index.html: HTML document, ASCII textg. findFind files in directoryfind directory options patternExample:$ find . -name README.md $ find /home/user1 -name '*.png'h. gunzipUn-compresses files compressed by gzip....
# in the filenames DIR="." # Controlling a loop with bash read command by redirecting STDOUT as # a STDIN to while loop # find will not truncate filenames containing spaces find $DIR -type f | while read file; do # using POSIX class [:space:] to find space in the filename ...
An # additional grant of patent rights can be found in the PATENTS file # in the same directory.if [[ -z $_fb_adb_print_messages ]]; then _fb_adb_print_messages=no fi : ${_fb_adb:=fb-adb} if ! type -p "$_fb_adb" >/dev/null 2>&1; then ...
You may find useful to use both. ### Define Debug environment ### Filename: my-debug-env if [[ -v TRACE ]]; then echo "Run TRACE mode" set -o xtrace # same as set -x fi if [[ -v NOOP ]]; then echo "Run NOOP mode" set -o noexec # same as set -n fi trap 'echo ...
git_log_empty_commits.sh - find empty commits in git history (eg. if a git filter-branch was run but --prune-empty was forgotten, leaking metadata like subjects containing file names or other sensitive info) git_log_me.sh - shows only commits in the Git log done by you. Useful to ...
printf的%q生成的输出被正确地加了引号以供shell阅读,但它通常不使用双引号。完整输出行的示例是make-...
The script is written in bash, and can be run as a standalone bash file or incorporated into a larger script. The use of shell scripting in this example makes it easy for users to quickly and easily manipulate files, allowing them to find and replace strings with ease. ...