Black-Hat Bash scripting part 2
To be honest, i did not feel like giving my thoughts but the promise i made to myself and what i noticed on my mental state it was fun, so here we are after church:
Arrays- lists, in bash’s case it’s 1 dimensional
so from the screenshot below i created an array known as card with a list of the cards that are values. According to the authors the first echo command will print all the elements, the asterisk(*) is just representing the elements that are listed and then the last echo command prints the numerical value that you specify in this case, the number of hearts, you can also do 1,2 and the output will be the latter.
yes, i am using macos but just for now till i need to get on kali as the authors recommend.
if you want to get rid of an array element use the unset command like so: unset card[1] and with that diamond is no more
Input prompting- not that different of the snake’s way of making a text video game or asking a user if they want to install a certain program
control operators- from what i am garnering from the table in the book, its more of characters that control the script, so let’s say if you watched one of those hollywood hacking pictures…the hacker in this case can be using a operator like & and without a potential victim knowing you can tell it sleep like so: sleep 100 &, i’m just spitballing here.
Pentagon won’t know what hit them
Till next time,
May you always be in a state of flow