RosettaCodeData/Task/Check-that-file-exists/UNIX-Shell/check-that-file-exists-2.sh
Ingy döt Net d066446780 langs a-z
2013-04-10 22:43:41 -07:00

8 lines
201 B
Bash

for f in input.txt /input.txt; do
test -f "$f" && r=true || r=false
echo "$f is a regular file? $r"
done
for d in docs /docs; do
test -d "$d" && r=true || r=false
echo "$d is a directory? $r"
done