Hello.. I wrote the following shell script to run disk quotas for assigning limits to users. I need to know the partition which the user has created and mount it. So i copied the partitions (which will be displayed after running fdisk -l) and separted the last line from it and cut the required partition name from it. Then this should be passed to the next line (using mount). Here I am facing the problem.. It is returning the error "device not found", that means the variable "$part" is not giving the partition name..
The following is my code:
VSIZE=100m;
fdisk /dev/sda >/dev/null 2>&1 <<EOF
n
p
3
+${VSIZE}M
w
EOF
partprobe /dev/sda
fdisk -l > file1
awk 'NF{s=$0}END{print s}' file1 > file2
cut -c "1 2 3 4 5 6 7 8 9 10" file2 > file3
part=`cat file3`
mkfs.ext3 $part
mkdir /var/likes
mount $part /var/likes
chmod 777 /var/likes
quotacheck -cugv /var/likes
quotaon $part
setquota -u kal 2 3 4 5 -a $part