I want my bash script to prepend all ports with their associated IP/FQDN (always above them in the file), replace the forward slash with a whitespace, and then delete the IP/FQDN line that isn't associated with a port. Breaking it down, I thought: Read the next...
aws_s3_buckets_block_public_access.sh - blocks public access to one or more given S3 buckets or files containing bucket names, one per line aws_s3_account_block_public_access.sh - blocks S3 public access at the AWS account level aws_s3_check_buckets_public_blocked.sh - iterates each S3...
Run the following command tofindall text files (*) in the working directory, filter, and print (grep) any files that contain theExamplesstring. find.-name"*.txt"|xargsgrep'Examples' As you can see below, two files contain theExamplesstring. Searching files containing a specific text Conclusi...
As the name suggests, it literally matches the string itself giving similar results to the = operator. For your reference, here, I have used one string containing z* and did the literal matching using the == operator: #!/bin/bash a="z*" if [[ "$a" == "z*" ]]; then echo "...
Repository files navigation README MIT licenseTable of ContentsBasic Operations 1.1. File Operations 1.2. Text Operations 1.3. Directory Operations 1.4. SSH, System Info & Network Operations 1.5. Process Monitoring Operations Basic Shell Programming 2.1. Variables 2.2. Array 2.3. String Substitution 2.4...
aws_s3_buckets_block_public_access.sh - blocks public access to one or more given S3 buckets or files containing bucket names, one per line aws_s3_account_block_public_access.sh - blocks S3 public access at the AWS account level aws_s3_check_buckets_public_blocked.sh - iterates each S3...
Division by zero or use of a string/float variable in a Bash Arithmetic Expression Incorrect subscript when dynamically populating a Bash Associative Array Parsing incorrectly a file or command output like when processing a CSV file in Bash or Counting Files in a Directory Running with incorrect su...
yes, block indent is used in yaml files to denote structure and hierarchy. each level of nesting in the yaml data is indented, typically with two spaces. this can make the yaml file easier to read and understand, especially if it's large or complex. can i use block indent in bash ...
az storage container delete \ --name $container Get list of containers containing a specific prefix and store results into a variable.azurecli Kopija containerPrefix="learnbash" containerList=$(az storage container list \ --query "[].name" \ --prefix $containerPrefix \ --output tsv) Delete...
Using %?ce, on the other hand, refers to any job containing the string ce in its command line. If the substring matches more than one job, bash reports an error. The symbols %% and %+ refer to the shell's notion of the current job, which is the last job stopped while it was in...