#!/bin/bash set -x cwd=$(pwd) echo Delete files whether they exist or not rm $cwd/contest/* 2> /dev/null echo Delete directory whether it exists or not rmdir $cwd/contest echo list directory to ensure it is gone ls -la $cwd/contest echo Make directory and create 2 files there mkdir $cwd/contest chmod 777 $cwd/contest touch $cwd/contest/file1 touch $cwd/contest/file2 chmod 777 $cwd/contest/* echo Now try to remove files and dir with python program python3 testosfnc.py echo Now list directory again, should be gone ls -la $cwd/contest