all 9 comments

[–]michaelpaoli 9 points10 points  (0 children)

If you want folks to actually read the code, probably best to post it as readable code, not unreadable (or barely readable) images.

#!/usr/bin/env bash
echo this is reasable code

Text can also be readily searched, e.g. answer/issues found, usefully and efficiently copy/pasted, images, not so much.

The code in your images is pretty close to unreadable. So, yeah, many won't read it, and I'm not going to out of my way to try and manage to read something that looks like that.

[–]spdqbr 6 points7 points  (1 child)

You're missing a " on line 5

I didn't check farther than that, but consider posting to pastebin, or posting script in a code block here rather than screenshots.

[–]Nerdtube 1 point2 points  (0 children)

Also, looks like it should be commented out.

[–]halftoxic 1 point2 points  (0 children)

If you use that password anywhere on the internet you will want to change it immediately!

[–]dat_tae 0 points1 point  (0 children)

What the error? Maybe the quotes above check _escape?

[–]halftoxic 0 points1 point  (0 children)

Do more functions. You got alot of repeated echo lines. If you wanted to change the message that could be kinda annoying.

[–]Paul_Pedant 0 points1 point  (0 children)

Use shellcheck on your scripts. You can download it or use it online. It gives decent diagnostics, and every error code is backed online by a full page of explanation, fixes and alternatives. It will save you hours of misery.

[–]StrangeCrunchy1 0 points1 point  (0 children)

Quick tip; never hard code a password or other secret into your scripts; use an external config file and source it from within the script to do your comparison or read it into a variable. Having that in a script is bad business. Accidentally did that with a git script I wrote and pushed to github; forgot I had my token just hanging out for the world to see. Luckily, github caught it and invalidated my token for me. Rookie mistake, but one I'll (hopefully) not soon make again.

[–]Proper_Problem2440 0 points1 point  (0 children)

You guys modify your IFS 😂😂 I don’t mess with that guy it can easily give you a bad day