Bash: If statement nested in for loop -
i writing simple script check if entered directory path exists. have
echo "please specify finish directory path" read file_path file in $file_path; if [[ -d "$file" ]]; echo "$file directory" break else echo "$file not directory, please seek again." fi done
what need if not directory go , inquire file path again.
thanks.
how this?
echo "please specify finish directory path" while read file; if [[ -d "$file" ]]; echo "$file directory" break fi echo "$file not directory, please seek again." done
bash if-statement for-loop
No comments:
Post a Comment