u/Dandedoo

234 post karma · 4,215 comment karma · joined Nov 2018

Dandedoo

You should have invited your wife oversees. You might have found a turkey! on your vacation away from workey

Dandedoo

Sony PVM-9045QM, Melbourne

Excellent picture, condition. Regretful sale.

$550

Melbourne, Australia

https://www.gumtree.com.au/s-ad/st-kilda/tvs/sony-pvm-9045qm-trinitron-crt-tv-rgb/1317457402

Dandedoo

Yes you should they are really innovative.

Dandedoo
while :; do
    if ram-condition; then
        kill <process>; touch file; etc
        sleep 6h
    else
        sleep 5m
    fi
done
Dandedoo

no magic bullet, no cure for pain \ what's done is done, until you do it again

Rhyming references?

Dandedoo

delete?

Dandedoo
grep -w "^/dev/nvme${num}n${num}"
Dandedoo

Unroll it all the way, wind it up with the blind against the wall.

Dandedoo

White bread, pasta, soy milk, and very little red meat. 🙄

Dandedoo

Post the nutrition tables.

Dandedoo
find . -type d -exec bash -c '
    shopt -s nullglob
    for dir do
        for i in "$dir"/*.mp3 do
            normalize "$dir"/*.mp3
            break
        done
    done
 ' _ {} +
Dandedoo

https://pubs.opengroup.org/onlinepubs/9699919799/utilities/tr.html

Don't use brackets (unless you mean them literally).

Dandedoo
parent=$(dirname "$PWD")

Or pure bash:

parent=${PWD%/*}
: ${parent:=/}
Dandedoo

Maybe you will find "$BASH_SOURCE" less “hideous”?

Dandedoo

That's not correct. bash tests are double bracket, and bash is also compatible with single bracket test syntax (and test).

Dandedoo

If you aren't running the script as user njames (or root), you won't have read permission for njames' home directory (and the -e test will fail).

Maybe you want ~/.config/windows.credentials instead.

Also double check the spelling of the file name.

Dandedoo

this

Dandedoo
w=<1025 digit number>
r=$(tr -dc 0-9 < /dev/urandom |
    dd bs=$((${#w}+1)) count=1 2>/dev/null)
echo "obase=16; $r % ($w-1) + 2" | bc

I think that's the same. Dunno if the mod of witness length + one is is true random or not.

Dandedoo
alias -p

(alias -p > aliases to save them)

Dandedoo

The error codes don't appear to specifically show the condition OP wants.

Dandedoo

This is pretty hacky, but I've had the need to parse error messages before. Using GNU sed for word boundaries.

snapshot_id=$(head -n 10 /home/egonzalez/ansible/awsoutput.txt)

for snapshot in $snapshot_id ; do
    aws ec2 modify-snapshot-tier --snapshot-id "${snapshot}"  --storage-tier archive \
    2> >(grep -Fw 'already in progress' &&
              sed -i "/\\<$snapshot\\>/d" id-file)
done

There may be a command which checks exactly for the "already running" condition you want, which would be better.

Dandedoo

Yeah, you should quote in single brackets. Here though it's actually ok, b/c the variable has already undergone word splitting in the select statement. Presumably why they don't quote anywhere else either (cd).

I misremembered the function thing, good to know.

Dandedoo

🤞

Dandedoo

Copy the file to an array (using the default delimiter of \n), then pass the array to rm:

mapfile -t files < ~/selection &&

rm -- "${files[@]}"

Or use xargs:

tr -s '\n' '\0' < ~/selection | xargs -0 rm --

(changing new lines to nulls, as I like to use `xargs -0` when possible, as it prevents any xargs parsing quirks eg. for single quotes and backslash)

Dandedoo

Just [[ $var ]] is fine too. I think the example is for POSIX/portable shell, not bash specifically. The only bashism is using a function (not POSIX, but many shells implement them).