Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
but for some devices like /sys/devices/virtual/net/lo/speed I'm getting "cat: /sys/devices/virtual/net/lo/speed: Invalid argument"
appending 2>&1 to the command doesn't help so I'm not sure where the error is coming from. Is there some way I can tell that I shouldn't try to access the data because it's not there? I've gotta believe there is some way to tell. I just did spot an operstate which says things like up, down or unknown that may be the answer. BUt I also found a 'tun' device with a state of unknown which DOES report a speed.
Ideally I'd rather not have to read a second file but I suppose it is what it is.
btw - I can't simply list of set of device names to ignore because I never know what's going to show up/
Maybe this is too simplistic, but how about checking the return code ?.
Those /sys/devices/virtual/net/lo/* pseudo files "exist" on my non-virtualized system; cat of speed gets rc=1, opstate gets rc=0. Just toss the message in the bit bucket ...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.