Comments on: Learn Practical BASH Scripting Projects – Part III https://www.tecmint.com/sailing-through-the-world-of-linux-bash-scripting-part-iii/ Tecmint - Linux Howtos, Tutorials, Guides, News, Tips and Tricks. Thu, 01 Feb 2024 06:44:28 +0000 hourly 1 By: vgon https://www.tecmint.com/sailing-through-the-world-of-linux-bash-scripting-part-iii/comment-page-1/#comment-781920 Wed, 18 May 2016 23:55:13 +0000 http://www.tecmint.com/?p=3555#comment-781920 #!/bin/bash
while :
do
ops==+-*/
opwords=( ” Sum Difference Product Quotient )
sum=0
read -ep “Enter first no.: ” n1
read -ep “Enter second no.: ” n2
printf “%d. %s\n” 1 Addition 2 Subtraction 3 Multiplication 4 Division
read -sn1 -ep “Enter your choice: ” ch
(( ch > 0 && ch < 5 )) &&
printf '%s: %d\n' "${opwords[ch]}" "$(( n1 ${ops:ch:1} n2 ))" ||
echo "Invalid choice"
read -sn1 -ep "Do you want to continue (y/n)?" i
[[ $i != "y" ]] && exit
done

]]>
By: dragodan https://www.tecmint.com/sailing-through-the-world-of-linux-bash-scripting-part-iii/comment-page-1/#comment-701001 Wed, 04 Nov 2015 14:19:40 +0000 http://www.tecmint.com/?p=3555#comment-701001 in up.sh script, why it is needed to have exec /bin/bash at the end. I tried without last line and it does not work.

Thanks in advance

]]>
By: Saravanan https://www.tecmint.com/sailing-through-the-world-of-linux-bash-scripting-part-iii/comment-page-1/#comment-353169 Thu, 30 Oct 2014 11:45:34 +0000 http://www.tecmint.com/?p=3555#comment-353169 Hi Team ,

Can you please explain how the rcmd command is working & how can i run multiple commands on remote machine by using the rcmd command. It will be useful if get the reply with the new post .

Regards,
Saravanan

]]>
By: Chris F.A. Johnson https://www.tecmint.com/sailing-through-the-world-of-linux-bash-scripting-part-iii/comment-page-1/#comment-217443 Fri, 18 Jul 2014 18:20:34 +0000 http://www.tecmint.com/?p=3555#comment-217443 #!/bin/bash
while :
do
ops==+-*/
opwords=( ” Sum Difference Product Quotient )
sum=0
read -ep “Enter first no.: ” n1
read -ep “Enter second no.: ” n2
printf “%d. %s\n” 1 Addition 2 Subtraction 3 Multiplication 4 Division
read -sn1 -ep “Enter your choice: ” ch
(( ch > 0 && ch < 5 )) &&
printf '%s: %d\n' "${opwords[ch]}" "$(( n1 ${ops:ch:1} n2 ))" ||
echo "Invalid choice"
read -sn1 -ep "Do you want to continue (y/n)?" i
[[ $i != "y" ]] && exit
done

]]>
By: Richard https://www.tecmint.com/sailing-through-the-world-of-linux-bash-scripting-part-iii/comment-page-1/#comment-55115 Tue, 08 Oct 2013 03:27:56 +0000 http://www.tecmint.com/?p=3555#comment-55115 In reply to Chris.

Hi Chris,

Could you elaborate? How would you change it? The test is inherent to the while statement and thus not needed. Correct?

rc

]]>