You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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