I know what the result will be but don't understand the conditional test. I've never seen it before nor can I find the -t option in any shell scripting tutorial
masijade1,351 Industrious Poster Team ColleagueFeatured Poster
man test
[ ] is a "shorthand"/"shell-builtin" for the command test. And, for reference, file-handle 0 is either standard out or standard in. I forget which and it has been years since I've had to worry about it.
Perhaps the '!' and the '[' should be swapped. Usually the 'not' works better if it's part of the test. :) Of course, shell scripting has become somewhat, mmm, different in the past 20 years, so it might just work the way you wrote it.
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.