Lab 3: Copy the file from one directory from another
echo "Enter the name of the two directories/folders and create them"
read dir1
read dir2
mkdir $dir1
mkdir $dir2
cd $dir1
echo "Enter the name of the directory file"
read file
echo "Create one directory file and save the content by pressing Ctrl+D"
cat> $file
cd ..
echo "$dir1 contains"
ls $dir1
cp ./$dir1/* ./$dir2/
echo "$dir2 contains"
ls $dir2
read dir1
read dir2
mkdir $dir1
mkdir $dir2
cd $dir1
echo "Enter the name of the directory file"
read file
echo "Create one directory file and save the content by pressing Ctrl+D"
cat> $file
cd ..
echo "$dir1 contains"
ls $dir1
cp ./$dir1/* ./$dir2/
echo "$dir2 contains"
ls $dir2
Leave a Comment