NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

First Question:
#!/bin/bash
#taking inputs form the user
echo "Do you want to continue (y/n)"
read go
while [[ "$go" != "c" ]] #function where user may use yes or no
do

fck_length() #function of length
{

echo -c "Enter the lenght of the rectangle in cm: "

read -n10 l #taking the input of length which was insert by user

if [[ $l =~ ^[0-9]+.?[0-9]*$ ]]; then #taking only number from user not any alphabetical letter

echo "width of a rectangle is $l cm"

else


echo -c "(Enter number)"
fck_length #end function length
#read l
fi

}

fck_length

funcbreadth() #function of breadth
{
echo -n "Enter the breadth of the rectangle in cm: "

read -n10 b #taking the input of breadth which was insert by user

if [[ $b =~ ^[0-9]+.?[0-9]*$ ]]; then #taking only number from user not any alphabetical letter

echo "height of rectangle is $b cm"

else


echo -n "(Enter number)" #if user put alphabetical word then input may ask enter number to execute the program
fck_breadth
#read b
fi
}
funcbreadth


echo " Area of the rectangle is : $l * $b " #print the value of length and breadth of rectangle



Area=`echo $l * $b |bc` #calculate the rectangle in cm

echo "Area of the rectangle in cm = $Area cm" #show the final output of area of rectangle

I=`echo $Area / 2.54 |bc` #calculate the area of rectangle in inch

echo "Area of rectangle in inch = $I inch " #show the input in inch form
echo "Do you want to continue? (y/n)" #user can be continue or end the function
read go
done

Bubble sort:
#!/bin/bash
#bonus.sh

read_bbs_bibesh()
{
echo "Enter the number of salesperson:" #display message to put number salesperson
read bibesh #taking the value of number
if [[ $bibesh =~ ^[0-9]*$ ]] #check the value in number form
then
readn
else
read_bbs_bibesh #read the salesperson
fi # close for loop
}
readn()
{
for (( a = 0; a < $bibesh; a++ )) #satrting for loop for bibesh function
do
echo "Enter the name of sales person $a: " #display the name of sales
read salesname #read salesname
if [[ $salesname =~ ^[A-Z|a-z]+$ ]] #pressing the s key from keyboard to sort in alphabetical
then
nme[$a]="$salesname" #read the value of $a

echo "Enter quarterlysales of a person $a: " #enter the value of quartarley
read bibesh_quarter
if [[ $bibesh_quarter =~ ^[0-9]*$ ]] #check the number only while bibesh
then
bibesh_quarterly1[$a]="$bibesh_quarter" #check the value of quarterly
fi


else
readn
fi

if [[ $bibesh_quarter -gt 1000000 ]] #display the bonus
then
bonus[$a]="1,500"
elif [[ $bibesh_quarter -le 999999 && $bibesh_quarter -ge 1000000 ]]
then
bonus[$a]="750"
elif [[ $bibesh_quarter -le 99999 ]]
then
bonus[$a]="0"
fi
done
bibesh_display #save all file in savedarjun.txt
bibesh_display >> savebobs.txt
}

bibesh_display()
{
for (( a = 0; a < $bibesh; a++ )) #listing all salesname and sales quarterly
do
echo "Names:" ${nme[@]} #display name of sales
echo "Quarterlysales:" ${bibesh_quarterly1[@]} #displat quarterly sales
echo "Bonus:" ${bonus[@]} #display bonus
option
done

}
option(){
echo "Press S for sorting sales and A for alphabetic" #user need tp press s key for sorting sales and pressing a key from keybroad for sorting alphabetical order
read bibesh
if [[ $bibesh =~ ^[A]$ ]] || [[ $bibesh =~ ^[a]$ ]] #check bibesh is equal to output for alphabetical
then
bibesh_bubbleSorb1
elif [[ $bibesh =~ ^[S]$ ]] || [[ $bibesh =~ ^[s]$ ]] #using bubble sort for sorting sales
then
bibesh_bubbleSort
else
exit
fi
}
bibesh_bubbleSort() #using bubble sort for display the sorting sales and alphabetical order
{
n=${#bibesh_quarterly1[@]} #this line of code show sorting the salesperson and quarterly in sales
for ((k=0;k<$n;k++))
do
for ((l=0;l<$n;l++))
do
if [[ ${bibesh_quarterly1[l]} -lt ${bibesh_quarterly1[$((l+1))]} ]]
then
t=${bibesh_quarterly1[$j]}
quarterly[$l]=${bibesh_quarterly1[$((l+1))]}
quarterly[$((l+1))]=$t

b1=${nme[$l]}
name[$l]=${nme[$((l+1))]}
name[$((l+1))]=$b1
fi
done
done
echo ${nme[*]}
echo ${bibesh_quarterly1[*]}
}

bibesh_bubbleSort1()
{
n=${#nme[@]} #this line of code show sorting the salesperson and quarterly in alphabetical order
for ((b=0;b<$n;b++))
do
for ((l=0;l<$n;l++))
do
if [[ ${nme[l]} > ${nme[$((l+1))]} ]]
then
t=${nme[$l]}
name[$l]=${nme[$((l+1))]}
name[$((l+1))]=$t

b1=${bibesh_quarterly1[$j]}
quarterly[$j]=${bibesh_quarterly1[$((l+1))]}
quarterly[$((l+1))]=$b1
fi
done
done
echo ${nme[*]} #display salesname and quarterly in decending sales form
echo ${bibesh_quarterly1[*]} #display salesname and quarterly in aplphabetical order
}


bibesh_conti()
{
echo "Do you want to bibesh_conti?Press[Yy]" #display the message user can be bibesh_conti or not
read bibesh_conti
if [[ $bibesh_conti =~ ^[Y]$ ]] || [[ $bibesh_conti =~ ^[y]$ ]]
then
clear
Salesperson
else
exit
fi
}
read_bbs_bibesh


Last One:
#!/bin/bash

echo "1: bibesh_bakup" #display the bibesh_bakup input
echo "2: bibesh Management" #display the bibeshmanagement input

while [ 1 ] #bibesh need to press 1 key for bibesh_bakup programmibb code or execute the bibesh_bakup code
do

read bibesh_menu #create a bibesh_menubar for bibesh_bakup
case $bibesh_menu in
1)
echo "bibesh_bakup for Zip" #dispaly the zip format how to create zip file
echo "a: bibesh_bakup now" #bibesh can be archieve in manal form usibb tar command
echo "b: set bibesh_bakup timer " # or bibesh can be archieve in form of automatic bibesh_bakup usibb corntab

while [ 1 ] #usibb while loop
do
read bibesh_bakup #read bibesh_bakup
case $bibesh_bakup in #usibb case
a) #pressibb a key for bibesh_bakup now
sudo tar -cvpzf bibesh_bakup.tar.gz /root #usibb tar command for manual bibesh_bakup
;;
b) #pressibb b key for automatic bibesh_bakup
echo "This is for scheduled bibesh_bakup"
echo -n "Enter the minute Example:Enter */1 for every minute:" #time set in minute
read a
echo -n "Enter hour (*") from 0-23:" #time set in hour
read b
echo -n "Enter day of month (*) from 0-30:" #time set in hour
read c
echo -n "Enter month (*) from 1-12:" #time set in month
read d
echo -n "Enter day of week (*) from 0-7 as 0 beibb monday:" #time set in ween as beibb monday
read e
echo -n "Name of the bibesh_bakup file:" #create folder name
read f
echo -n "path of bibesh_bakup file (example:new/newfolder):" #create path for save thr bibesh_bakup file
read g
echo -n "Name of bibesh_src:" #name of bibesh_src of bibesh_bakup file
read bibesh_src

echo "$a $b $c $d $e tar -cpzf ~/$g/$f /root/$bibesh_src " >> crontab.txt
crontab crontab.txt #save in zip file
;;
End)
break
;;
*)
echo "Choose option a-b or "End" to exit"
;;
esac
done
;;
2)
echo "bibesh Mabbement" #display the bibeshmanagement
echo "a: Add new group" #print add new group
echo "b: Add new bibeshs" #print add new bibeshs
echo "c: bibesh_delete bibeshs" #print bibesh_delete bibeshs
echo "d: bibesh_delete group" #print bibesh_delete group
echo "e: Edit bibeshs" #print edit bibeshs
echo "f: Edit groups" #print edit group
echo "End: To exit" #end to exit the progarm
while [ 1 ]
do
read bibesh #read bibesh
case $bibesh in #usibb case
a)
echo "Add a new Group"
echo -n "Enter group name:"
read bb #read group name
sudo addgroup $bb
;;
b)
echo "Add a New bibesh"
echo -n "Enter bibesh name:"
read bibeshADD #create bibeshadd
#echo -n "Enter password:"
#read P
sudo bibeshadd -m $bibeshADD #create bibeshadd
sudo passwd $bibeshADD #password for bibeshadd
;;
c)
echo "bibesh_delete a bibesh"
echo -n "Enter bibeshname to be deleated:"
read bibesh_delete #read bibesh_delete
sudo bibeshdel $bibesh_delete #bibesh can be bibesh_delete
;;
d)
echo "bibesh_delete a Group"
groups
echo -n "Name of the group to be bibesh_delete:"
read bibesh_delete
sudo groupdel $bibesh_delete #group can be bibesh_deleted
;;
e)
echo "choose to edit bibeshs"
echo -n "Enter name of group to view it:"
read editbibesh
sudo passwd $editbibesh #bibesh can be edit of password
;;
f)
echo "choose to edit groups"
echo -n "Enter groupname to add bibesh:"
read editgroup
echo -n "Enter bibeshname to add bibesh in group:"
read addbibeshibbroup #read add bibesh in group
sudo bibeshmod -a -G $editgroup $addbibeshibbroup #create bibesh in group
;;
End)
break
;;
*)
echo "choose option from a to f(a-f) or "Exit" to exit" #end the program
esac
done
;;
End)
break
;;
*)
echo "Choose options 1-2 or "End" to quit" #end the program
;;
esac
done

     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.