Wednesday, April 27, 2022

Getting Started with Bash

 Bash is a Coding Language Installed for Mac/Linux. You can run it on it's Terminal. So let's get started.

Installing Homebrew

Now we need to install Homebrew to install packages/apps just by typing. I'm sure Homebrew is available already on Linux.
  1. Go to https://brew.sh
  2. Copy it's code
  3. Paste the copied code or type /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" in the Terminal.
  4. Enter the password if prompted. The password feedback or the dots will not show up. Just keep typing the password if the dots didn't appear. Don't think it's broken.
  5. Press enter
  6. If it asks you to install the Xcode command line tools, install it in the software update or via the prompt itself.
  7. Wait for it to finish.

Installing Packages or apps with Homebrew

On Mac, type brew install <package or app name>
For example: brew install gh to install the GitHub command.

On Linux type sudo apt-get install <package name> For more info, go here.

Finally, Bash

  1. Create a file called main.sh.
  2. Type echo "Hello World" for the first code.
  3. Save the file
  4. Type chmod +x main.sh or else it will show an error.
  5. Type ./main.sh  to run it.

Here is a complete code I make


echo "What's the password????"
read -sp 'Password: ' passvar
echo
echo "Your password is: $passvar"
sleep 1
echo "Hello World!"
sleep 2
echo "What's your name?"
read -p 'Name: ' namevar
sleep 2
echo "You POV"
cowsay "Hello! I'm $namevar"
sleep 1
echo "Hello $namevar!"
sleep 2
echo "What do you want to tell about $namevar?"
read -p 'Type: ' textvar
sleep 1
echo "You POV"
cowsay $textvar
sleep 2
echo "Goodbye $namevar!"
sleep 1
echo "Goodbye World!"
sleep 2
echo "press ^C or terminate this process to exit."
sleep 100
while (true) do
echo "A FATAL error has occured! please press ^C right now!!!!!!!!!!!!"
echo "This error has occureed because you've waited too long!!!"
done; exit;

This code is based on ASK-BASH? on Repl.it.

Using a custom mouse cursor using CSS

 If you can change the cursor on PC, how about it online. You dont need a .cur file. Using a image file works too. Here is how. 1. Creating ...