How to Write BASH Scripts? Laying the Foundation or Starting from Scratch

Опубликовано: 27 Сентябрь 2026
на канале: IT-спец. Денис Курец
48,139
1.5k

In today's episode, we'll cover the very basics of writing your own scripts using shell scripts, and also practice with some conditional operators.

•••••••••••••••••••••••••••••••••••••••••••••••••

"Cybersecurity Specialist Profession" course from Skillbox — https://clc.to/8fmbYQ
Use promo code "Hacking in Russia" for a 50% discount. Tell your manager and receive a discount and profit.

•••••••••••••••••••••••••••••••••••••••••••

CTRL+C CTRL+V:
#!/bin/bash
echo "What do you want to scan: subnet/ip"
read use
if [ "$use" = "subnet" ]; then
echo "Enter subnet:"
read subnet
echo "Enter port:"
read port
nmap -p $port -sT $subnet -oG res
cat res |grep open ANGLE BRACKET result
cat result
else
echo "Enter IP:"
read IP
nmap -PE $IP -oN resultip
cat resultip
fi

•••••••••••••••••••••••••••••••••••••••••••••••••••••••••

Advanced training courses and materials from the author:
https://kurets.ru/infoprodukty

••••••••••••••••••••••••••••••••••••••••••••••••••••••••••

Hi, my name is Denis Kurets, and I am a practicing system administrator and I'm a computer security specialist. I worked as a teacher for a long time, teaching the younger generation of networkers skills in protecting personal data, operating network infrastructure, and other incredibly useful things.

On this channel, I share my experience working with various applications on Windows and Linux systems, and I also review computer and related devices. I regularly collaborate with companies such as Acronis, Cisco, Kaspersky Lab, ESET, FirstVDS, and other renowned IT brands.

•• ... https://Kurets.Ru/Instagram
✓ ODNOKLASSNIKI: https://Kurets.Ru/OK
✓ TELEGRAM: https://Kurets.Ru/Telegram
✓ TWITTER: https://kurets.ru/Twitter

•••••••••••••••••••••••••••••••••••••••••••••••••••••••

Additional tags: #bash #scripts #basics #start #programming