forsyth20121205-174063a80cc13 years agoHistory
82 lines · 1.4 KB · Text
RawDownload
.TH FTEST 1.SH NAMEftest, newer \- test file attributes.SH SYNOPSIS.B ftest.I test.I arg.PP.B newer.I file1.I file2.SH DESCRIPTION.I Ftestchecks the specified attribute of .I argaccording to.I testand yields an exit status signifying the result.For all.IR test sapart from.BR -t ,.I argis the name of the file to be tested;for.BR -t ,it is the number of a file descriptor.Available tests are:.TP.B -dTrue if the file exists and is a directory..TP.B -eTrue if the file exists..TP.B -fTrue if the file exists and is a regular file..TP.B -rTrue if the file exists and is readable..TP.B -sTrue if the file exists and has non-zero size..TP.B -tTrue if the open file represented bythe number.I argrepresents the same file as.BR /dev/cons ..TP.B -wTrue if the file exists and is writable..TP.B -xTrue if the file exists and is executable..LP.I Newerchecks whether.I file1exists and is no older than.IR file2 ,which must also exist;if so, it yields a true exit status.Otherwise, it yields an error status.Neither file may be a directory..SH SOURCE.B /appl/cmd/ftest.b.br.B /appl/cmd/newer.b.SH SEE ALSO.IR sys-stat (2).SH BUGSThese commandswork only with.IR sh (1)as none of the other Inferno shellscan check the exit status of a command..PPChecking for read, write and execute capabilitiesis speculative - the file server has the last say.Group permissions are ignored.