Skip to content

KALI – How to write the BOOM Script – For Loops – The Visual Guide


Bash Scripting allows the creation of “for loops”.  Here we make the boom script using bash scripting in nano.

Step 1 – Open Nano


{This creates a file called}

Step 2 – Enter this code


for i in `seq 10 -1 1`


echo -en “${1} …”

done ; echo “BOOM”

boom script

Step 3 – Save the Script

Ctrl+O = save the script

It should automatically name itself

Ctrl+X = exit nano


Step 4 = Make the script executable

chmod +x

Step 5 – Run the boom script


boom outputFor loops work on FIXED lists of items

Here it counts down from 10 to 1, minus 1 at each loop.

It display the variable each time

At the end of the program, after the for loop has completed it prints out “BOOM”.

boom output 2



University of South Wales Reading list

PARKER, S.  2011.  Shell Scripting – Expert recipes for Linux, Bash, and More.  Indianapolis: John Wiley & Sons.


KALI – First things to do after installing Kali Debian Linux – The Visual Guide

One Comment
  1. socket2012 permalink

    You can put this code line instead of loop for to reach the same goal:
    for i in {10..1}


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: