User Tools

Site Tools


linux:bash

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
linux:bash [2023/07/11 07:19] – [No Passwd Sudo] bstaffordlinux:bash [2023/07/25 15:20] (current) – [Read File] bstafford
Line 8: Line 8:
 EDITOR="$VISUAL" ; export EDITOR</code> EDITOR="$VISUAL" ; export EDITOR</code>
  
 +===== Read File =====
 +Read a list of words from a file [[https://blog.apnic.net/2023/07/19/the-joy-of-txt/|source]]
 +
 +<code>#!/bin/bash
 +domainsfile="domains.txt"
 +
 +while read domain
 +do
 +    echo "--"
 +    echo "[$(date)] CHECKING DOMAIN $domain"
 +    echo "--"
 +
 +    host -W 5 -t txt "$domain". # -W 5 for a 5 second timeout
 +done < "$domainsfile"</code>
 +<code>./get-txt-records.sh > host.out 2>&1</code>
 ===== Sudo ===== ===== Sudo =====
 Add user to sudo list in ''visudo'' Add user to sudo list in ''visudo''
linux/bash.1689059986.txt.gz · Last modified: by bstafford