Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
I thought of that too PHV, but what happens if there are only hidden files in the dir? And won't test complain about missing operators if the $dir/* expands to multiple names?PHV said:[ $dir/* = "$dir/*" ] && echo $dir is empty
[ -z "ls -A $dir" ] && echo $dir is empty
b01301$ mkdir newtestdir
b01301$ export dir=newtestdir
b01301$ [ -e $dir/* ] || echo $dir is empty
newtestdir is empty
b01301$ touch newtestdir/.hidden
b01301$ [ -e $dir/* ] || echo $dir is empty
newtestdir is empty
b01301$ touch newtestdir/nothidden
b01301$ [ -e $dir/* ] || echo $dir is empty
b01301$ touch newtestdir/nothidden2
b01301$ [ -e $dir/* ] || echo $dir is empty
[ -z "$(ls -A $dir)" ] && echo $dir is empty
b01301$ rm -fr newtestdir
b01301$ mkdir newtestdir
b01301$ [ -e $dir/* ] || [ -f $dir/.[!.]* ] || echo $dir is empty
newtestdir is empty
b01301$ touch newtestdir/.hidden
b01301$ [ -e $dir/* ] || [ -f $dir/.[!.]* ] || echo $dir is empty
b01301$ touch newtestdir/.hidden2
b01301$ [ -e $dir/* ] || [ -f $dir/.[!.]* ] || echo $dir is empty
b01301$ touch newtestdir/nothidden
b01301$ [ -e $dir/* ] || [ -f $dir/.[!.]* ] || echo $dir is empty
b01301$ touch newtestdir/nothidden2
b01301$ [ -e $dir/* ] || [ -f $dir/.[!.]* ] || echo $dir is empty