Discussion:
Valid filename
(too old to reply)
Y.T. Lim
2014-02-14 03:51:29 UTC
Permalink
When a string is received in bash, is there a way to determine if it is a valid Unix filename?

/YT
David W. Hodgins
2014-02-15 09:46:31 UTC
Permalink
Post by Y.T. Lim
When a string is received in bash, is there a way to determine if it is a valid Unix filename?
See http://www.linfo.org/file_name.html

Spaces, and newline characters are valid in file names, but should
be avoided when possible, to avoid parsing errors in scripts.

Otherwise, the only characters not allowed in a file name are / and
hex '00'.

If the script is allowing a path, in front of the file name, then
the / is ok.

Regards, Dave Hodgins
--
Change nomail.afraid.org to ody.ca to reply by email.
(nomail.afraid.org has been set up specifically for
use in usenet. Feel free to use it yourself.)
Loading...