
Shell_Make
文章平均质量分 55
amaowolf
这个作者很懒,什么都没留下…
展开
-
make-002: eclipse下autoconf和automake
1)src下删除helloword.c添加自己的程序 #ifndef STUDENT_H_#define STUDENT_H_typedef struct student{ int age; char name[20]; struct student *next;}STUDENT;#endif /* STUDENT_H_ */#include#include原创 2012-09-12 09:50:46 · 843 阅读 · 0 评论 -
shell-008: user-variable system-env
0.变量的配置守则变量与变量内容以一个等号『=』来连结,如下所示: 『myname=VBird』等号两边不能直接接空格符,如下所示为错误: 『myname = VBird』或『myname=VBird Tsai』变量名称只能是英文字母与数字,但是开头字符不能是数字,如下为错误: 『2myname=VBird』变量内容若有空格符可使用双引号原创 2012-10-08 17:02:30 · 603 阅读 · 0 评论 -
make-003: 强大的Makefile
1.CC=gccCFLAGS=-g -Wallall:slurm_clientslurm_client: slurm_client.o config.o socket_client.o $(CC) $(CFLAGS) $^ -o $@%.o: %.c $(CC) $(CFLAGS) -c $< clean: rm -f *.o slurm_client2.原创 2012-10-09 17:47:51 · 508 阅读 · 0 评论 -
shell-15:if语句
if 语句格式if 条件then Commandelse Commandfi 别忘了这个结尾If语句忘了结尾fitest.sh: line 14: syntax error: unexpected end of fi if 的三种条件表达式转载 2012-10-11 15:07:34 · 646 阅读 · 0 评论 -
shell-16: /etc/init.d/slurm-serverd
#!/bin/sh## chkconfig: 2345 80 50# description: slurm_server is for setup the socket at slurm side# # processname: slurm_server ## Source function library.. /etc/rc.d/init.d/funct原创 2012-10-11 17:14:58 · 979 阅读 · 0 评论 -
shell-14: linux awk 命令应用
linux awk 命令应用:awk的语法:awk [ -F re] [parameter...] ['prog'] [-f progfile][in_file...]参数说明:-F re:允许awk更改其字段分隔符。parameter: 该参数帮助为不同的变量赋值。'prog': awk的程序语句段。这个语句段必须用单拓号:'和'括起,以防被shell解释。这个程序语转载 2012-10-10 08:03:07 · 653 阅读 · 0 评论 -
eclipse + autotools (1)
1. 新创建一个c语言工程auto,选用“Hello World ASCI C Autotools Project”, eclipse会调用autoscan/aclocal/ automake/autoconf自动创建一些列文件 2. 在src目录下写自己的代码,例如src/configconfig.hconfig.cconfig_test.ccontainer原创 2012-11-02 16:57:22 · 1853 阅读 · 0 评论 -
makefile
支持在elcipse 以automake 方式建工程,发布的版本可以像大多数gnu 软件一样 ./confiure , make , make install 就可以搞定autotools plug-in 的功能说来弱得可怜,下面是建一个工程的步骤1、 在elcipse 中new 一个 autotools make 的工程2、手工创建automake 需要的文件 configure.a转载 2012-11-01 23:26:09 · 480 阅读 · 0 评论 -
利用libtool自动生成动态库的Makefile的生成方法
### 利用libtool自动生成动态库#1. autoscan命令在当前目录生成configure.scan文件, 内容为:# -*- Autoconf -*-# Process this file with autoconf to produce a configure script.AC_PREREQ(2.57)AC_INIT(转载 2012-11-07 16:29:16 · 6795 阅读 · 0 评论 -
No.1: autoconf automake
1. configure.ac# -*- Autoconf -*-# Process this file with autoconf to produce a configure script.AC_PREREQ([2.68])AC_INIT([zz-test], [1.0], [amao.ch原创 2012-11-11 21:40:27 · 1543 阅读 · 0 评论 -
configure error
If you having trouble compiling any application manually using “configure” , here simple fix for this error.Error ::checking whether we are using the GNU C++ compiler... nochecking whether g++ acc转载 2012-11-26 13:11:25 · 1155 阅读 · 0 评论 -
What are shell wildcards
What are shell wildcards >Wildcards are a shell feature that makes the command line much more powerful than any GUI file managers. You see, if you want to select a big group of files in a graphica转载 2012-11-16 14:48:21 · 628 阅读 · 0 评论 -
Linux Shell 通配符、元字符、转义符使用实例介绍
Linux Shell 通配符、元字符、转义符使用实例介绍说到shell通配符(wildcard),大家在使用时候会经常用到。下面是一个实例:?1 ?1234[chengmo@localhost ~/shel转载 2012-11-16 15:10:37 · 839 阅读 · 0 评论 -
shell-006: case
1. echo -n "Is it morning? Please input yes or no: "read yesornocase "$yesorno" in [yY]*) echo "Good Morning";; [nN]*) echo "Good afternoon";; *) echo "Sorry"原创 2012-10-08 16:55:27 · 450 阅读 · 0 评论 -
shell-005: until
1#!/bin/bashuntil who|grep "S1" > /dev/nulldo sleep 60doneecho -e \\aecho "******* $1 has just logged in******"exit 0原创 2012-10-08 16:53:32 · 313 阅读 · 0 评论 -
shell-003 通配符 与 转义字符
1. 通配符* 代表任意的字符串,可以是空字符串? 代表一个字符,不可以为空例zip*: 以zip开头的字符串,如zip、ziper*zip:以zip结尾的字符串,如zip、gunzip、unzip*zip*: 包含zip的字符串,如zip、bunzip2、bzip2*:任意的字符串z*e: 以z开头e结尾的字符串,如zipnote、zi原创 2012-05-09 16:12:07 · 975 阅读 · 0 评论 -
shell-001 撰写一个clearlog.sh脚本
1. 撰写一个clearlog.sh脚本[root@localhost shell]# cat clearlog.sh#!/bin/bashcp /dev/null /var/log/apache2/access.log注:/dev/null大小为0,内容为空拷贝空文件覆盖日志文件access.log,即清空该文件2. 修改文件执行权限chmod +x原创 2012-05-09 15:56:32 · 560 阅读 · 0 评论 -
make-001: automake和autoconf小记
1. 源程序[root@node001 str]# cat include/str.h #include int str(char *string);[root@node001 str]# cat src/str.c #include "str.h"//print stringint str(char *string){printf("\n----PRI原创 2012-09-06 17:36:00 · 468 阅读 · 0 评论 -
shell-004 算术表达式操作方法汇总
0.#!/bin/bashecho -e "a*b=? a-b=? \n"read -p "please input the value of a:" aread -p "please input the value of b:" bresult=$((a*b))echo "a*b = $result"result2=$(($a-$b))echo "a-b = $result2原创 2012-05-09 16:15:55 · 770 阅读 · 0 评论 -
shell-009: function
1#!/bin/bashyes_or_no () { echo "Is your name $*? " while true ; do echo -n "Enter yes or no: " read x case "$x" in y | yes ) return 0 ;; n原创 2012-10-08 17:12:54 · 405 阅读 · 0 评论 -
shell-002 while
0#!/bin/bashi=1while ((i<20))do ((i=i+1))doneecho $i1. baby_rocker.shbaby_rocker.sh#!/bin/bashwhile [ 1=1 ]do eject eject -t done2. repeat.sh#!/bin/bashde原创 2012-05-09 16:05:01 · 575 阅读 · 0 评论 -
shell-009: create 3 files named respectively by date
1#!/bin/bash#Program:# create 3 files named respectively by date#Date:# 2010-11-22# read -p "Please input the your NameID:" NameIDfile1="$NameID""`date --date='2 days ago' +%Y%m%d`"file2=原创 2012-10-08 17:05:05 · 440 阅读 · 0 评论 -
shell-010: APP: phone number
cnencaoj7mbp1:shell caoj7$ cat phone.cdb zhangsan 18899999999cnencaoj7mbp1:shell caoj7$ cat phone.sh#!/bin/bashphone_book="phone.cdb"menu_choice=""tmp_file=tmp.$$trap 'rm -f $phone_book' INT原创 2012-10-08 17:16:42 · 674 阅读 · 0 评论 -
shell-011: gquestionaire
#!/bin/bashgdialog --title "Questionaire" --msgbox "Welcome to my simple survey" 9 18 gdialog --title "Confirm" --yesno "Are you willing to take part?" 9 18if [ $? != 0 ]; then gdialog --inf原创 2012-10-08 17:17:43 · 834 阅读 · 0 评论 -
shell-13: /etc/init.d/munge
[caoj7@node001 study]$ cat /etc/init.d/munge#!/bin/sh################################################################################ $Id: munge.init.in 890 2011-01-20 01:54:21Z chris.m.dunlap $##转载 2012-10-09 15:39:12 · 2126 阅读 · 0 评论 -
shell-007: if elif else
#!/bin/bashecho -n "Is it morning? please input yes or no: "read yesornoif "$yesorno" = y* then echo "Good morning"elif [ "$yesorno" = "no" ] || [ "$yesorno" = "NO" ] then echo "Go原创 2012-10-08 16:57:27 · 1545 阅读 · 1 评论 -
shell-012: 特殊符号
1. $:(关于本 shell 的 PID)?:(关于上个运行命令的回传值)2.[vbird@www ~]# cp /var/spool/mail/root /etc/crontab \> /etc/fstab /root利用『 \[Enter] 』来将 [Enter] 这个按键『跳脱!』开来,让 [Enter] 按键不再具有『开始运行』的功能!3原创 2012-10-09 08:13:24 · 627 阅读 · 0 评论 -
常规正则表达式
常规正则表达式:元字符及其在正则表达式上下文中的行为:/ 将下一个字符标记为一个特殊字符、或一个原义字符、或一个后向引用、或一个八进制转义符。^ 匹配输入字符串的开始位置。如果设置了 RegExp 对象的Multiline 属性,^ 也匹配 ’/n’ 或 ’/r’ 之后的位置。$ 匹配输入字符串的结束位置。如果设置了 RegExp 对象的Multiline 属性,$ 也匹配 ’转载 2012-10-09 11:07:12 · 838 阅读 · 0 评论