开发者

data validation for date data type in unix?

开发者 https://www.devze.com 2022-12-14 03:03 出处:网络
for eg if i m getting various inputs from keyboard ie Book accession numb开发者_StackOverflow社区er,

for eg if i m getting various inputs from keyboard ie Book accession numb开发者_StackOverflow社区er, Subject code Book_id ,

Author ,

Year of Publication, Title of the book, Publisher’s name, Price,

and i want do validations such that

year of publication must be before 1996, Book_id must be unique, Publisher, Author and the title of the Book cannot be entered blank, Subject code can only be either UNIX or C, The Book accession numbers must be in ascending order,

how do i store all values first and do validations for data types like date


I guess it would make more sense to put this stuff in to a database. Then create a select. In shell programming it's also posible, but would create a lot of work and it could get a bad performance.


Using Perl is another good option since it has date modules in it, and it's faster. If you don't have DB access.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号