Linux程序设计 终端
对终端进行读写
在编写程序时,我们往往需要从终端读入数据。一种情况是需要连续地读入用户键入的选择项,这往往出现在数据库程序中。程序员往往会使用
getchar
函数来读取数据,继而判断输入的数据是否有效,从而做出反应。其实如此做带有很大的风险,一个实例程序如下
#include <stdio.h>
char *menu[] = {
"a - add new record",
"d - delete record",
"q - quit",
NULL
};
int getchoice(char *choices[]){
int chosen = 0;
int selected;
char **option;
do {
option = choices;
while(*option){
printf("%s\n", *option);
option++;
}
selected = getchar();
option = choices;
while(*option){
相关文档:
一:前言
最近在研究android的sensor driver,主要是E-compass,其中用到了Linux input子系统.在网上也看了很多这方面的资料,感觉还是这篇分析的比较细致透彻,因此转载一下以便自己学习,同时和大家分享!
(这篇博客主要是以键盘驱动为例的,不过讲解的是Linux Input Subsystem,可以仔细的研究一下!)
键盘驱动将检 ......
我们把下载的三个软件包放到/var/local目录下(这是笔者个人的习惯),它们都是tar.gz包,可以用命令tar -xzpvf 包名,把它们在当前目录(/var/local/)中解开:
cd /var/local
tar -xzpvf mysql-4.0.15.tar.gz
tar -xzpvf php-4.3.3.tar.gz
tar -xzpvf httpd-2.0.47.tar.gz
解包后可以开始进入正式安装。 ......
1. 用 oracle 用户登录
如果要再次安装, 最好先做一些备份工作。
包括用户的登录脚本,数据库自动启动关闭的脚本,和 Listener 自动启动的脚本。
要是有可能连创建数据库的脚本也保存下来
2. 使用 SQL*PLUS 停止数据库
[oracle@ora920 oracle]$ sqlplus /nolog
SQL> connect / as sysdba
SQL> shutdown ......
Securing your Linux server is important to protect your data, intellectual property, and time, from the hands of crackers (hackers). The system administrator is responsible for security Linux box. In this first part of a Linux server security series, I will provide 20 hardening tips for default inst ......