Computing.Net > Forums > Unix > how to determine if device is busy

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

how to determine if device is busy

Reply to Message Icon

Name: f
Date: July 29, 2003 at 10:48:52 Pacific
OS: Linux
CPU/Ram: Athlon/512
Comment:

I am currently writing a bash script (this is my second day into bash scripting) and I have problem figuring out how to determine if /dev/ttyX is busy. So far I have only one idea, to simply use cat which says smth like 'Device busy' if it's busy. But I don' t think it is the best way to do it.
Any ideas?

Thanx




Sponsored Link
Ads by Google

Response Number 1
Name: David Perry
Date: July 29, 2003 at 20:03:13 Pacific
Reply:

Does the output of "who" help you?


0

Response Number 2
Name: f
Date: July 29, 2003 at 22:44:44 Pacific
Reply:

David, no, who will not help, because in this case tty is a special device(Digi adapter port) wich will not show up in "who".
So far I have figured out to use "lsof | grep "/dev/tty_name" in if statement test.


0

Response Number 3
Name: David Perry
Date: July 31, 2003 at 05:56:24 Pacific
Reply:

How about

lsof

?


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


trouble with string != pa... Extracting from tar file



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: how to determine if device is busy

How to determine file exist or not? www.computing.net/answers/unix/how-to-determine-file-exist-or-not/3976.html

how to check the bits of HP Unix www.computing.net/answers/unix/how-to-check-the-bits-of-hp-unix/5964.html

How to know when FTP is complete? www.computing.net/answers/unix/how-to-know-when-ftp-is-complete/5388.html