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 :

  • How To Install Cinnamon In Ubuntu 14.04
  • How To Install Mate Desktop In Ubuntu 14.04
  • Creating the first Windows Server 2003 Domain Controller in a domain
  • How To Install Ubuntu 13.10 Server
  • How to Install Nuvola Player in Ubuntu
  • How to establish Emerald in Ubuntu 13.10 & Linux Mint 16
  • How to Restoring iptables Automatically On Boot on Debian and Ubuntu
  • How to Compile FFMPEG with H.264 and LAME in Ubuntu And Debian
  • How to Install Linux on a Playstation 2
  • apt-fast: Improve apt-get Download Speed
  • Artikel terkait :