Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

Continuous bash script to do tasks again after confirmation

opt=y
while [ $opt = y -o $opt = Y ]
do
        echo -e "Enter first  number: c"
        read -r a

if [ $(bc <<< "$a > 0.0 && $a > 0") ]; then
        result=$(bc <<< "scale=2; $a * $a")
        echo "Square of $a: $result"
else
        echo "Put a number. Nothing else."
fi

echo -e "Want to continue? [y/n] c"
read -r wish

if [ $wish == y -o $wish == Y ]; then
        continue
else
        exit
fi

done
Comment

PREVIOUS NEXT
Code Example
Shell :: curl download with rate limit default 
Shell :: Installing Atom in Ubuntu OS 
Shell :: print each filename in a newline in ls 
Shell :: command to display topmost cpu intensive running processes 
Shell :: ubuntu show window current desktop 
Shell :: sanity coding with basir 
Shell :: command to view the content of a compressed tar file 
Shell :: envsub file 
Shell :: shell remove pdf pages 
Shell :: install postgresql and phppgadmin client 
Shell :: make your react an electron desktop app 
Shell :: yarn gem 
Shell :: match all css media queries 
Shell :: digital ocean how to install joomla 16.04 
Shell :: kubernetes remove taint 
Shell :: how to see files being watched by git 
Shell :: android studio avd system image download 
Shell :: spryker install silex 
Shell :: get folder size in lnux 
Shell :: undo popup when deleting files in ubuntu Ubuntu 20.04.4 LTS 
Shell :: nginx brotli 
Shell :: ring packages 
Shell :: how to create a file and multiple lines to it in unix 
Shell :: vim replace word with copied 
Shell :: can you speak in linux commands 
Shell :: ubuntu apt install default path 
Shell :: ubuntu tftp server 
Shell :: shell script multithreaing 
Shell :: sudo apt-get -y install unity-greeter 
Shell :: script to delete a range of history in terminal mac 
ADD CONTENT
Topic
Content
Source link
Name
7+3 =