While scanning a filesystem for changes with a shellscript, I forgot to exclude /dev, so core got tested too. Strangely enough, which ever way I test it, it is not consistent for a type:$ if [ -f ./core ] ; then echo file ; else echo something else ; fifile$ ls -al corelrwxrwxrwx 1 root root 11 Sep 29 15:40 core -> /proc/kcore$ file corecore: symbolic link to `/proc/kcore' $ if test -f core ; then echo file ; else echo something else ; fifile$ if /usr/bin/test -f core ; then echo file ; else echo something else ; fifile$ if test -h core ; then echo link ; else echo something else ; filink$ if /usr/bin/test -h core ; then echo link ; else echo something else ; filinkWhat is going on here?
What type of file is /dev/core or /proc/kcore?
linux;scripting;kernel;linux kernel