unix

Qt用到的开发工具

亡梦爱人 提交于 2020-02-03 03:34:49
Qt 不是凭空产生的,它是基于现有工具链打造而成的,它所使用的编译器、链接器、调试器等都不是自己的,Qt 官方只是开发了上层工具。下面我们分几个部分讲解 Qt 使用到的工具链。 GNU 工具集 在上个世纪八十年代,计算机都是奢侈品,操作系统里最著名的是 Unix 家族, 当时还没有 Windows、 Linux 之类的,Unix 系统都是商业软件,里面的应用软件也是商业软件, 全是封闭的环境。 系统程序员 Richard M. Stallman (RMS) 在此环境下创立了与众不同的 GNU 项目 (GNU's Not Unix) , 以及推进自由软件发展的 Free Software Foundation (FSF) 自由软件基金会 。 GNU 项目是为了创建自由的类 Unix 系统,也因此开发出来很多开源的系统工具,其中非常著名的就是 GCC (GNU Compiler Collection,GNU编译器套件)。 现在我们知道,GUN 开发类 Unix 系统的项目失败了,但是它开发的一系列工具集却用到了后来的 Linux 内核上,两者结合形成了今天的各种 Linux 发行版,有兴趣的读者请转到《 Linux和UNIX的关系及区别 》了解更多。 在 GNU 工具集里面,开发时常见到的几个罗列如下(这些工具通常位于 Linux 或 Unix 系统里的 /usr/bin/ 目录):

UNIX网络编程——getsockname和getpeername函数

丶灬走出姿态 提交于 2020-02-02 20:40:12
这两个函数或者返回与某个套接字关联的 本地协议地址 (getsockname),或者返回与某个套接字关联的 外地协议地址 即得到 对方的地址 (getpeername)。 #include <sys/socket.h> int getsockname(int sockfd,struct sockaddr* localaddr,socklen_t *addrlen); int getpeername(int sockfd,struct sockaddr* peeraddr,socklen_t *addrlen); 均返回:若成功则为0,失败则为-1 getpeername只有在连接建立以后才调用 ,否则不能正确获得对方地址和端口,所以它的参数描述字一般是 已连接描述字而非监听套接口描述字。 没有连接的UDP不能调用getpeername,但是可以调用getsockname和TCP一样,它的地址和端口不是在调用socket就指定了,而是在第一次调用sendto函数以后。 已经连接的UDP,在调用connect以后,这2个函数(getsockname,getpeername)都是可以用的。但是这时意义不大,因为已经连接(connect)的UDP已经知道对方的地址。 需要这两个函数的理由如下: 在一个没有调用bind的 TCP客户 上, connect成功返回后

need to send html mail with attachment in unix

半世苍凉 提交于 2020-02-02 16:27:47
问题 I am facing problems in sending html mail with attachemnt.I will able to send mail with attachment (plain text ) using mailx -s and uuencode command and also html mail without attachment using sendmail option. However I am not able to send html mail along with attachment. Either one of it is working (html mail or attachment) Below are the different ways I have tried. Could you please help me in resolving the same. 1) Failed because of illegal option base64 #!/usr/bin/ksh export MAILTO="abc

Detecting exit status on process substitution

自作多情 提交于 2020-02-02 14:01:47
问题 I'm currently using bash 4.1 and I'm using a function to perform a SVN cat on a repository file. After that, it iterates over each line to perform some transformations (mostly concatenations and such). If said file does not exist, the script should stop with an error message. The script is as follows: function getFile { svnCat=`svn cat (file) 2>&1` if [[ -n $(echo "$svnCat" | grep "W160013") ]]; then # W160013 is the returned value by SVN stderr case a file doesn't exist echo "File doesn't

Detecting exit status on process substitution

老子叫甜甜 提交于 2020-02-02 14:01:27
问题 I'm currently using bash 4.1 and I'm using a function to perform a SVN cat on a repository file. After that, it iterates over each line to perform some transformations (mostly concatenations and such). If said file does not exist, the script should stop with an error message. The script is as follows: function getFile { svnCat=`svn cat (file) 2>&1` if [[ -n $(echo "$svnCat" | grep "W160013") ]]; then # W160013 is the returned value by SVN stderr case a file doesn't exist echo "File doesn't

How to handle error/exception in shell script?

谁都会走 提交于 2020-02-02 02:41:11
问题 Below is my script that I am executing in the bash. And it works fine. fileexist=0 for i in $( ls /data/read-only/clv/daily/Finished-HADOOP_EXPORT_&processDate#.done); do mv /data/read-only/clv/daily/Finished-HADOOP_EXPORT_&processDate#.done /data/read-only/clv/daily/archieve-wip/ fileexist=1 done Problem Statement:- In my above shell script which has to be run daily using cron job , I don't have any error/exception handling mechanism . Suppose if anything gets wrong then I don't know what's

C program: __start [duplicate]

我只是一个虾纸丫 提交于 2020-02-02 02:15:32
问题 This question already has answers here : What is the use of _start() in C? (4 answers) Closed 13 days ago . Can you help me to understand how __start is used in C internally? Is it the exact replica of the main function or is it the entry point to the compiled program? Just wondering, how its getting used? 回答1: Here is a good overview of what happens during program startup before main . In particular, it shows that __start is the actual entry point to your program from OS viewpoint. It is the

Linux与UNIX的区别与联系

依然范特西╮ 提交于 2020-02-02 02:07:54
UNIX诞生于20世纪60年代末,Windows诞生于20世纪80年代中期,而Linux诞生于20世纪90年代初,可以说UNIX是操作系统中的“老大哥”。 分时操作系统 :是一台计算机可以同时为多个用户服务,连接计算机的终端用户交互式发出命令,操作系统采用时间片轮转的方式处理用户的服务请求,并在终端上显示结果(操作系统将CPU的时间划分成若干个片段,称为时间片)。操作系统以时间片为单位,轮流为每个用户服务,每次服务一个时间片。 目前常见的UNIX版本有Sun Solaris,FreeBSD,IBM AIX,HP-UX等,值得一提的是,苹果公司的OS X就是基于FreeBSD的操作系统。 Linux是一个类似UNIX的操作系统,其设计初衷是为了替代UNIX,并在功能和用户体验上进行优化,常见版本有Debian Linux、Fedora Core、CentOS、Red Hat Linux等。 区别 : 1.UNIX系统大多是与硬件配套的,而Linux则可以运行在多种硬件平台上; 2.UNIX是商业软件,而Linux是开源软件,免费且公开源代码; 3.UNIX和Linux不存在技术上面的传承关系,Linux是从新构建的系统; 4.UNIX是一个功能非常全面的操作系统,在某些方面超越了Linux,例如大型主机的可靠性。 系统结构 : 1. 内核层: 内核层是UNIX

Apache与php解析器通信方式分析(mod_php的apache2hander模块模式与php-fpm的fastcgi管理器模式分析)

淺唱寂寞╮ 提交于 2020-02-01 21:44:27
Apache与php解析器通信方式分析(mod_php的apache2hander模块模式与php-fpm的fastcgi管理器模式分析) 在apache(Unix平台最流行的WEB服务器平台)之中调用PHP是个经久不衰的话题,目前的PHP存在PHP4和PHP5的版本,而且在apache(Unix平台最流行的WEB服务器平台)之中调用PHP还存在module(模块)方式和CGI方式,同时apache(Unix平台最流行的WEB服务器平台)还存在apache(Unix平台最流行的WEB服务器平台)1和apache(Unix平台最流行的WEB服务器平台)2两个版本.   在apache(Unix平台最流行的WEB服务器平台)之中调用PHP存在以下八种模式:   1,PHP4在apache(Unix平台最流行的WEB服务器平台)1的module模式   2,PHP4在apache(Unix平台最流行的WEB服务器平台)1的cgi模式   3,PHP5在apache(Unix平台最流行的WEB服务器平台)1的module模式   4,PHP5在apache(Unix平台最流行的WEB服务器平台)1的cgi模式   5,PHP4在apache(Unix平台最流行的WEB服务器平台)2的module模式   6,PHP4在apache(Unix平台最流行的WEB服务器平台)2的cgi模式  

Prevent R from using virtual memory on unix/linux?

北慕城南 提交于 2020-02-01 15:29:08
问题 Short version Is there a way to prevent R from ever using any virtual memory on a unix machine? Whenever it happens it is because I screwed up and I then want to abort the computation. Longer version I am working with a big datasets on a powerful computer shared with several other people. Sometimes I set off commands that requires more RAM than is available, which causes R to start swapping and eventually freeze the whole machine. Normally I can solve this by setting a ulimit in my ~/.bashrc