Hi, I'm trying to make a script that has to check if a device such as the cd or rmt is available, or at least defined.
So I thought about looking for /dev/cd0 or /dev/rmt0 with:
if [ ! -f /dev/$1 ]
then
echo "Error, no such device /dev/$1"
$1 should be rmt0 or cd0.
I've tried with rmt0, that is in a defined state, and ls /dev shows there is a /dev/rmt0, but when I run the script it shows the "Error, no such device /dev/rmt0" sentence.
So I suppose that -f only works with plain files, not with /dev ones. Does anyone know how I can check this? It's AIX 5300-4.
Thanks
So I thought about looking for /dev/cd0 or /dev/rmt0 with:
if [ ! -f /dev/$1 ]
then
echo "Error, no such device /dev/$1"
$1 should be rmt0 or cd0.
I've tried with rmt0, that is in a defined state, and ls /dev shows there is a /dev/rmt0, but when I run the script it shows the "Error, no such device /dev/rmt0" sentence.
So I suppose that -f only works with plain files, not with /dev ones. Does anyone know how I can check this? It's AIX 5300-4.
Thanks