What is the difference between test -L filename
and test -h filename
in ksh shell. From the man page, both were used to identify a symbolic link, but I want to know the exact difference.
Here is the description from the man page.
-h file True if file exists and is a sym-
bolic link.
-L file True if file exists and is a sym-
bolic link.
test: countable noun A test is a deliberate action or experiment to find out how well something works. testing: 2. uncountable noun Testing is the activity of testing something or someone in order to find out information.
The Difference between Test and Exam – Meaning Both are basically forms of assessing skills or knowledge or specimens. One can differentiate between these two terms based on the context they are used for. Tests are a much more simplified process, whereas exams are an extensive process that is used to reach a result.
In the US it's always on the test. "I hope you do well on the test" is correct. "Try to stay relaxed in the test" is not anything that I've heard. The more common preposition is "during the test" -- although if someone said "in the test" I'd know what they meant.
COMMON ERRORS ► Don't say 'make a test'. Say take a test or do a test.
The source code for ksh93
, in file bltins/test.c
, shows that these two options are treated exactly the same, except for the author's hopes for the future:
case 'L':
case 'h': /* undocumented, and hopefully will disappear */
if(*arg==0 || arg[strlen(arg)-1]=='/' || lstat(arg,&statb)<0)
return(0);
return(S_ISLNK(statb.st_mode));
From this I conclude that they behave exactly the same, but that -h
is a legacy option and may one day disappear :-)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With