this BASH script will make you a MILLIONAIRE
About this video
Despite the title, the creator is explicit that this Bash script will not make you rich: it is a Bash-skills lesson that ends by adding a random number to your age to jokingly predict when you will become a millionaire. Working in a cloud Linux lab on Linode, he first builds getrichquick.sh — creating the file with a shebang, making it executable with chmod +x, prompting for name and age with read variables, and echoing them back. He then introduces built-in variables such as $RANDOM (which generates 0 to 32,767), $SHELL, $USER, $PWD and $HOSTNAME, shows how to create your own variable, and explains that a plain shell variable is not visible to child processes like scripts until you export it as an environment variable. To make it permanent across logins, he adds the export line to the hidden .bashrc file, which runs at each login. Finally he teaches Bash arithmetic with $(( )), notes Bash does integer-only division, and uses modulo (%) to constrain the random range — $RANDOM % 15 gives 0 through 14 — storing age plus that value in a variable and printing the joke millionaire age.
Key takeaways
- The millionaire premise is a joke hook; the real content is Bash variables, arithmetic and environment variables
- Use built-in variables like $RANDOM, $SHELL, $USER, $PWD and $HOSTNAME without setting them yourself
- A variable set in your shell is invisible to scripts (child processes) until you export it as an environment variable
- Make an exported variable permanent by adding its export line to ~/.bashrc, which runs on each login; the change only takes effect after logging in again
- Constrain randomness with modulo inside an arithmetic expression: $(( $RANDOM % 15 )) yields 0-14, and Bash arithmetic is integer-only by default
Episode details: published May 6, 2022 · 19:20 long. Summary written by Self Growth Videos from the episode itself. Business results and any income figures mentioned are NetworkChuck’s own claims, shared for education — they are not typical or guaranteed.
← Previous: Adding stuff to a Python List · Next: deleting stuff from Python Lists // Python RIGHT NOW!! // EP 9 →
All NetworkChuck videos · NetworkChuck profile · NetworkChuck on YouTube





