UNIX Lab Programs
UNIX Lab Programs
a.
c.
e.
Prog2
#!/bin/bash
for file in *; do
#Check if the file has read, write and execute permissions for the current user
echo $file
fi
done
Prog3
clear
read n
read fn
set $fn
do
echo -e "------------"
grep -c "$i" $*
echo -e "------------"
done
Prog4
read fileName
if [ ! -f $fileName ]
then
exit 1
fi
command
read file1
read file2
then
echo Same
rm $file2
else
echo Different
fi
Prog7a
#!/bin/bash
if [ ! -f "$1" ]; then
exit 1
fi
# Loop through each line in the file and count lines without vowels
count=0
((count++))
fi
Prog7b
#!/bin/bash
# !/bin/bash
read dir
if [ -d "$dir" ];
then
echo "$directory"
else
fi
Prog 9
#!/bin/bash
echo "$logged_in_users"
Prog 10
#!/bin/bash
echo "$logged_in_users"
6.