为学习APUE(Unix环境高级编程)偷懒,而写的脚本,基本上相当于一个简单的工程创建脚本了
来源:互联网 发布:汽车租赁管理系统java 编辑:程序博客网 时间:2024/04/26 03:55
首先我单独建了一个目录用来保存学习时需要的目录,将此脚本拷贝到这个目录下面,以后每次以一个参数运行脚本,就会自动创建目录,cpp文件,makefile文件,需要做的就是进入此目录,然后修改cpp文件,然后make,enjoy it!呵呵,说实话,自从学习了bash以后,才越来越觉得linux并不是一个复杂难用的系统。
D:/ubuntu/apue/ctapue.sh.html 1 #!/usr/bin/env bash
2 dir=apue$1
3 file=${dir}/apue${1}.cpp
4 makefile=${dir}/Makefile
5
6 if [ -d ${dir} ]
7 then
8 echo "the path ${dir} is exist."
9 exit 1
10 else
11 mkdir ${dir}
12 fi
13
14 # Create the src file
15 cat >${file} <<end-of-file
16 #include <stdio.h>
17 #include "../apue.h"
18
19
20 int main(int argc, char* argv[])
21 {
22
23
24 exit(0);
25 }
26
27 end-of-file
28
29 # Create the makefile
30 cat >${makefile} <<end-of-makefile
31 src=apue${1}.cpp
32 ob=test
33 /${ob} : /${src}
34 g++ -Wall -g -o /${ob} /${src}
35
36 end-of-makefile
2 dir=apue$1
3 file=${dir}/apue${1}.cpp
4 makefile=${dir}/Makefile
5
6 if [ -d ${dir} ]
7 then
8 echo "the path ${dir} is exist."
9 exit 1
10 else
11 mkdir ${dir}
12 fi
13
14 # Create the src file
15 cat >${file} <<end-of-file
16 #include <stdio.h>
17 #include "../apue.h"
18
19
20 int main(int argc, char* argv[])
21 {
22
23
24 exit(0);
25 }
26
27 end-of-file
28
29 # Create the makefile
30 cat >${makefile} <<end-of-makefile
31 src=apue${1}.cpp
32 ob=test
33 /${ob} : /${src}
34 g++ -Wall -g -o /${ob} /${src}
35
36 end-of-makefile
- 为学习APUE(Unix环境高级编程)偷懒,而写的脚本,基本上相当于一个简单的工程创建脚本了
- UNIX环境高级编程的apue.h源码-APUE
- Linux学习笔记(06-11)UNIX环境高级编程 apue.h头文件的配置
- UNIX环境高级高级编程中apue.h的解决方法
- UNIX 环境高级编程(一) apue.h 文件与apue.3e的安装
- 【UNIX高级编程】关于UNIX编程环境的配置(apue.h和error.h)
- UNIX环境高级编程Apue.h文件的配置
- UNIX环境高级编程的附录(apue.h)
- 《UNIX环境高级编程》apue源代码Ubuntu下的编译
- UNIX环境高级编程 apue.h头文件的配置
- 《UNIX环境高级编程》中apue.h的问题
- 《UNIX环境高级编程》apue源代码Ubuntu下的编译
- 《unix环境高级编程》APUE 习题5.4 的解答
- 《UNIX环境高级编程》apue源代码Ubuntu下的编译
- 《UNIX环境高级编程》中apue.h的问题
- <<UNIX环境高级编程>>apue.h头文件的配置
- UNIX环境高级编程 apue.h头文件的配置
- UNIX环境高级编程apue.h包头找不到的情况
- 在提供静态方法中,创建单例,并提供静态方法访问单例中的方法
- iPod: The Missing Manual [ILLUSTRATED]
- Java Swing 1 -- JTextField
- Essential CVS [ILLUSTRATED]
- Computer Viruses and Malware (Advances in Information Security)
- 为学习APUE(Unix环境高级编程)偷懒,而写的脚本,基本上相当于一个简单的工程创建脚本了
- TruCluster Server Handbook
- Windows下堆内存管理机制研究
- varchar和nvarchar
- An Introduction to Language Processing with Perl and Prolog: An Outline of Theories, Implementation,
- Adobe Digital Video How-Tos: 100 Essential Techniques with Adobe Production Studio
- 关于struts2的struts.xml中向action传参数的问题
- CSS Hacks and Filters: Making Cascading Stylesheets Work
- Start-to-Finish Visual Basic 2005: Learn Visual Basic 2005 as You Design and Develop a Complete Appl