bash 有道词典,数据库加强版
发布时间:2020-12-15 07:15:01 所属栏目:安全 来源:网络整理
导读:今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 #!/bin/bashdatabasepath='/home/quanwei/desktop/dict'sqlite3 $databasepath "create table if not exists dict (key text,value text,time int def
以下代码由PHP站长网 52php.cn收集自互联网 现在PHP站长网小编把它分享给大家,仅供参考 #!/bin/bash databasepath='/home/quanwei/desktop/dict' sqlite3 $databasepath "create table if not exists dict (key text,value text,time int default 1,createtime datetime);" value=`sqlite3 $databasepath "select value from dict where key='[email?protected]'"` if [ $value ]; then echo $value sqlite3 $databasepath "update dict set time=(select time from dict where key='[email?protected]')+1 where key='[email?protected]'" & else url="http://fanyi.youdao.com/openapi.do?keyfrom=quanwei9958&key=2020891949&type=data&doctype=text&version=1.0&q=%1" answer=`curl -G --data-urlencode [email?protected] ${url} 2>/dev/null|grep result` answer=${answer#result=} echo $answer time=`date` sqlite3 $databasepath "insert into dict(key,value,createtime) values('[email?protected]','$answer','$time')" & fi 以上内容由PHP站长网【52php.cn】收集整理供大家参考研究 如果以上内容对您有帮助,欢迎收藏、点赞、推荐、分享。 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- 数组 – 如何将Scala Array传递到scala vararg方法?
- 基于DEV控件库的webservice打印.repx模板
- scala – 基于类的类型参数的Poly1方法中的HList映射
- Bootstrap 响应式珊格布局
- bash – 最好的方法是编写一个运行命令并记录其退出代码的包
- 让 Angular 应用动起来!
- angularjs – ng-bind-html – 如何在新窗口中打开链接?
- angularjs 在指令中通过dom修改input 的Value值同时更新mod
- 角色2 AuthGuard Firebase认证
- 如何将Scala Spark DataFrames架构导出到Json文件?