Skip to content

Latest commit

 

History

History
52 lines (49 loc) · 1.26 KB

day7-report.org

File metadata and controls

52 lines (49 loc) · 1.26 KB

2016-Feb-05-satarday

From 9:30 AM TO 01:00 PM :

  • I have practised all the shell commands and wrote the simple shell script using following commands
 #!/bin/bash
 yum -y update
 yum install -y mysql-server
if [ $? -eq 0 ]
then
 echo "succefuly installed mysql-server"
else
 echo "unable to install mysql-server"
exit
fi
  • To create multiple folders as well as create files at once using through for loop
for i in {1..10}
do
mkdir /home/<foldername>$i
touch /home/<fiename>$i
done
  • chmod <options> <mode> <file/foldername>
chmod 766 <filename>

From 2:00 PM TO 5:00 PM :

  • Read various online articles about Functions in shell script. And also completed online tutorials and done assignment as well.
  • Creating various shell script to automate the tasks. So far I used following things in my shell script with the help of following things I used various commands that I am already aware of to perform specific tasks.
  • for loop Command line aruguments using $?, $1,$2 variables
To create multiple folders through functions
syntax:=
function_name ()
 { 
   list of commands
}

Ex:=
folder ()
{
    folder $1
}
for i in {1..10}
do
mkdir folder$i
done