Merge pull request #8 from FastFingertips/FOTV

Update while-loop.sh
This commit is contained in:
Ankam Ravi Kumar
2022-01-04 12:29:24 +05:30
committed by GitHub
15 changed files with 29 additions and 20 deletions

View File

@ -5,6 +5,7 @@
#Modified Date:
#Author: Ankam Ravi Kumar
# START #
echo -e "Please enter some value: \c"
read -r a
echo -e "Please enter another value: \c"

View File

@ -7,14 +7,14 @@
#Author: Ankam Ravi Kumar
# START #
echo "enter the a vloue $a"
echo -e "enter the a value: \c"
read a
echo "enter the b volue $b"
echo -e "enter the b value: \c"
read b
if test "$a" -gt "$b" ; then
echo "$a is greater than $b"
else
echo "$b is greater than $a"
echo "$b is greater than $a"
fi
# END #

View File

@ -5,6 +5,7 @@
#Modified Date:
#Author: Ankam Ravi Kumar
# START #
echo -e "Please Enter Maths Marks: \c"
read -r m
echo -e "Please Enter Physics Marks: \c"

View File

@ -6,6 +6,7 @@
#WebSite: https://arkit.co.in
#Author: Ankam Ravi Kumar
# START #
fruits=( "Apple" "Orange" "Banana" "Sapota" )
fruits[3]='Green Apple'
for fruit in ${fruits[@]}

View File

@ -7,7 +7,7 @@
#Author: Ankam Ravi Kumar
# START #
echo "WEL COME TO $USER"
echo "WEL COME TO $USERNAME"
echo "Your present working directory is `pwd`"
echo "current logged in users are `who`"
echo "Today date is `date`"

8
hi.sh
View File

@ -9,13 +9,13 @@
tmp=`date | cut -c12-13`
if [ $tmp -lt 11 ] ; then
echo "Good Mornind have a nice day $USER"
echo "Good Mornind have a nice day $USERNAME"
elif [ $tmp -gt 11 -a $tmp -lt 16 ] ; then
echo "Good Ofter noon $USER"
echo "Good Ofter noon $USERNAME"
elif [ $tmp -gt 15 -a $tmp -lt 19 ] ; then
echo "Good Evening $USER"
echo "Good Evening $USERNAME"
else
echo "Good Night Sweet dreams $USER"
echo "Good Night Sweet dreams $USERNAME"
fi
echo "Now the time is `date |cut -c12-19`"

View File

@ -5,6 +5,7 @@
#Modified Date:
#Author: Ankam Ravi Kumar
# START #
echo -e "Please Enter a Value: \c"
read -r a
echo -e "Please Enter b Value: \c"

View File

@ -6,7 +6,7 @@
#Website: https://arkit.co.in
#Author: Ankam Ravi Kumar
# START #
echo -e "Enter any value> \c"
echo -e "Enter any value: \c"
read -r a
echo -e "Enter any value: \c"
read -r b

View File

@ -10,8 +10,8 @@
echo "Hi you there"
echo "what is your name? (Type your name here and press Enter)"
read NM
echo "Hi $NM Good Morning"
echo "your currently logged in as $USER"
echo "Hi $NM Good Morning"
echo "your currently logged in as $USERNAME"
echo "your present working directory is `pwd`"
# END #

View File

@ -7,7 +7,7 @@
#Modified by:
# START
echo "Welcome $USER"
echo "Welcome $USERNAME"
echo "Your present working directory is `pwd`"
echo "Today date is `date`"
# END

View File

@ -5,6 +5,7 @@
#Modified Date:
#Author: Ankam Ravi Kumar
# START #
echo -e "Please Enter Maths Marks: \c"
read -r m
echo -e "Please Enter Physics Marks: \c"

View File

@ -5,7 +5,8 @@
#Modified Date:
#Author: Ankam Ravi Kumar
# START #
echo -e "Enter First Numberic Value: \c"
echo -e "Enter First Numeric Value: \c"
read -r t
echo -e "Enter Second Numeric Value: \c"
read -r b
@ -13,7 +14,7 @@ read -r b
if [ $t -le 20 -o $b -ge 30 ]; then
echo "Statement is True"
else
echo "Flase, Statement Try Again."
echo "False Statement, Try Again."
fi
# END #

View File

@ -5,7 +5,7 @@
##WebSite: https://arkit.co.in
##Start
echo "Please Enter User name you want check:\c"
echo -e "Please Enter User name you want check: \c"
read user
grep $user /etc/passwd > /dev/null
if [ $? -eq 0 ]; then

View File

@ -6,6 +6,7 @@
#website: https://arkit.co.in
#Author: Ankam Ravi Kumar
# START #
A=10
Ba=23
BA=45

View File

@ -1,8 +1,10 @@
While Loop Example, print any given number table.
#!/bin/bash
## While Loop Example with 2 table
echo -e "Please provide one value:\c"
# While Loop Example with 2 table, print any given number table.
# See Full Explanation of this above shell script [while loop](https://www.youtube.com/Techarkit?sub_confirmation=1)
#START
echo -e "Please provide one value: \c"
read -r c
i=1
while [ $i -le 10 ]
@ -12,4 +14,4 @@ echo "$c * $i = $b"
i=`expr $i + 1`
done
See Full Explanation of this above shell script [while loop](https://www.youtube.com/Techarkit?sub_confirmation=1)
#END