Download files using shell

This is just a basic for the beginners

#!/bin/bash
echo -en "\e[31mEnter link To Download:\e[0m "  

# echo -en "\e[31;1mEnter link:\e[0m "  
# -n so that the value can be entered in the same line itself.

read lnk

#echo -e "\e[0m"
# read command reads the value from standard input.

cd /root/downloads && wget $lnk

# 31 - Red
# 32 - Green
# 34 - Blue

# 31;1m - Bold Red
# 31;7m - Invert Red to background.

Make shell script interactive using ' read '

We can make the shell script interactive. read will let the user to enter values while the script is being executed. Input entered through the keyboard read into the variables followedby read, and the program execution continues.


Terima kasih telah membaca artikel tentang Download files using shell di blog Tutorial Opensource and Linux jika anda ingin menyebar luaskan artikel ini di mohon untuk mencantumkan link sebagai Sumbernya, dan bila artikel ini bermanfaat silakan bookmark halaman ini di web browser anda, dengan cara menekan Ctrl + D pada tombol keyboard anda.

Artikel terbaru :