# vi del_files.sh#!/bin/kshinput_file="input.txt"output_file="result.txt"delete_flag=0while getopts ":d" opt; do case $opt in d) delete_flag=1 ;; *) echo "Usage: $0 [-d]"; exit 1 ;; esacdone> "$output_file"while IFS= read -r filepathdo if [ -e "$filepath" ]; then if [ $delete_flag -eq 1 ]; then if rm "$filepath" 2>/dev/null; then echo "$filepath,D" >> "$output_file" else ec..