1827286 Members
1649 Online
109717 Solutions
New Discussion

Block or Network file?

 
SOLVED
Go to solution
Robin Abecasis
Advisor

Block or Network file?

Basically, why do :

[[ -b /dev/vg00/lvol1 ]] && echo yes || echo no

and

[[ -n /dev/vg00/lvol1 ]] && echo yes || echo no

both return yes?

Why is KSH treating the device file as both a Block file (expected) and a Network file (unexpected)? This happen under HPUX 10.20 and 11.

Cheers in advance,
Robin
Wots going on 'ere then?
2 REPLIES 2
James R. Ferguson
Acclaimed Contributor
Solution

Re: Block or Network file?

Hi Robin:

The 'n' option of 'test' tests for a non-zero string length.

...JRF...
Robin Abecasis
Advisor

Re: Block or Network file?

DOh! Sorry for such a silly question! I somehow got it into my head that the '-n' was for checking whether the file was a 'network special file' as described by ls. :-|

Robin
Wots going on 'ere then?