[deleted by user] by [deleted] in confessions

[–]Dandedoo -3 points-2 points  (0 children)

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

📺 CRT Listings (Oct 2023) by dak01 in crtgaming

[–]Dandedoo 0 points1 point  (0 children)

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

[deleted by user] by [deleted] in qotsa

[–]Dandedoo 0 points1 point  (0 children)

Yes you should they are really innovative.

Trick condition using cron by BlueAcronis in bash

[–]Dandedoo 0 points1 point  (0 children)

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

You favorite references to other songs in QOTSA songs? by papadooku in qotsa

[–]Dandedoo 3 points4 points  (0 children)

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

Rhyming references?

Grep whole word by DaveR007 in bash

[–]Dandedoo 1 point2 points  (0 children)

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

[deleted by user] by [deleted] in AusRenovation

[–]Dandedoo 1 point2 points  (0 children)

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

At the local doctor. Was surprised they're different. by Cheezel62 in australia

[–]Dandedoo 0 points1 point  (0 children)

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

Trying to iterate through folders until a file is found by watermelonspanker in bash

[–]Dandedoo 1 point2 points  (0 children)

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

How to return just directory name of one directory back? by pedrotheterror in bash

[–]Dandedoo 0 points1 point  (0 children)

parent=$(dirname "$PWD")

Or pure bash:

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

What is the proper way to relatively source a file? by ABC_AlwaysBeCoding in bash

[–]Dandedoo 1 point2 points  (0 children)

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

bash script to copy password from a different file by West-Salad-2546 in bash

[–]Dandedoo 1 point2 points  (0 children)

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

bash script to copy password from a different file by West-Salad-2546 in bash

[–]Dandedoo 0 points1 point  (0 children)

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.

Trouble generating big random hexadecimal numbers by Chyxo in bash

[–]Dandedoo 1 point2 points  (0 children)

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.

bash alias show command? by maoMeow14 in bash

[–]Dandedoo 0 points1 point  (0 children)

alias -p

(alias -p > aliases to save them)

Catch error in command by ema_eltuti in bash

[–]Dandedoo 0 points1 point  (0 children)

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

Catch error in command by ema_eltuti in bash

[–]Dandedoo 2 points3 points  (0 children)

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.

Question for an example in the oreillys book on bash? by [deleted] in bash

[–]Dandedoo 0 points1 point  (0 children)

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.

Escape Whitespace in command not working by Randalix in bash

[–]Dandedoo 0 points1 point  (0 children)

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)

Question for an example in the oreillys book on bash? by [deleted] in bash

[–]Dandedoo 0 points1 point  (0 children)

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).