
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 · 860 阅读 · 0 评论 -
shell-008: user-variable system-env
0. 变量的配置守则 变量与变量内容以一个等号『=』来连结,如下所示: 『myname=VBird』 等号两边不能直接接空格符,如下所示为错误: 『myname = VBird』或『myname=VBird Tsai』 变量名称只能是英文字母与数字,但是开头字符不能是数字,如下为错误: 『2myname=VBird』 变量内容若有空格符可使用双引号原创 2012-10-08 17:02:30 · 615 阅读 · 0 评论 -
make-003: 强大的Makefile
1. CC=gcc CFLAGS=-g -Wall all:slurm_client slurm_client: slurm_client.o config.o socket_client.o $(CC) $(CFLAGS) $^ -o $@ %.o: %.c $(CC) $(CFLAGS) -c $< clean: rm -f *.o slurm_client 2.原创 2012-10-09 17:47:51 · 521 阅读 · 0 评论 -
shell-15:if语句
if 语句格式 if 条件 then Command else Command fi 别忘了这个结尾 If语句忘了结尾fi test.sh: line 14: syntax error: unexpected end of fi if 的三种条件表达式转载 2012-10-11 15:07:34 · 654 阅读 · 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 · 991 阅读 · 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 · 664 阅读 · 0 评论 -
eclipse + autotools (1)
1. 新创建一个c语言工程auto,选用“Hello World ASCI C Autotools Project”, eclipse会调用autoscan/aclocal/ automake/autoconf自动创建一些列文件 2. 在src目录下写自己的代码,例如 src/ config config.h config.c config_test.c container原创 2012-11-02 16:57:22 · 1872 阅读 · 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 · 490 阅读 · 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 · 6823 阅读 · 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 · 1558 阅读 · 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 · 1185 阅读 · 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 · 641 阅读 · 0 评论 -
Linux Shell 通配符、元字符、转义符使用实例介绍
Linux Shell 通配符、元字符、转义符使用实例介绍 说到shell通配符(wildcard),大家在使用时候会经常用到。下面是一个实例: ? 1 ? 1 2 3 4 [chengmo@localhost ~/shel转载 2012-11-16 15:10:37 · 845 阅读 · 0 评论 -
shell-006: case
1. echo -n "Is it morning? Please input yes or no: " read yesorno case "$yesorno" in [yY]*) echo "Good Morning";; [nN]*) echo "Good afternoon";; *) echo "Sorry"原创 2012-10-08 16:55:27 · 459 阅读 · 0 评论 -
shell-005: until
1 #!/bin/bash until who|grep "S1" > /dev/null do sleep 60 done echo -e \\a echo "******* $1 has just logged in******" exit 0原创 2012-10-08 16:53:32 · 326 阅读 · 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 · 989 阅读 · 0 评论 -
shell-001 撰写一个clearlog.sh脚本
1. 撰写一个clearlog.sh脚本 [root@localhost shell]# cat clearlog.sh #!/bin/bash cp /dev/null /var/log/apache2/access.log 注:/dev/null大小为0,内容为空 拷贝空文件覆盖日志文件access.log,即清空该文件 2. 修改文件执行权限 chmod +x原创 2012-05-09 15:56:32 · 576 阅读 · 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 string int str(char *string){ printf("\n----PRI原创 2012-09-06 17:36:00 · 479 阅读 · 0 评论 -
shell-004 算术表达式操作方法汇总
0. #!/bin/bash echo -e "a*b=? a-b=? \n" read -p "please input the value of a:" a read -p "please input the value of b:" b result=$((a*b)) echo "a*b = $result" result2=$(($a-$b)) echo "a-b = $result2原创 2012-05-09 16:15:55 · 787 阅读 · 0 评论 -
shell-009: function
1 #!/bin/bash yes_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 · 415 阅读 · 0 评论 -
shell-002 while
0 #!/bin/bash i=1 while ((i<20)) do ((i=i+1)) done echo $i 1. baby_rocker.sh baby_rocker.sh #!/bin/bash while [ 1=1 ] do eject eject -t done 2. repeat.sh #!/bin/bash de原创 2012-05-09 16:05:01 · 586 阅读 · 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:" NameID file1="$NameID""`date --date='2 days ago' +%Y%m%d`" file2=原创 2012-10-08 17:05:05 · 452 阅读 · 0 评论 -
shell-010: APP: phone number
cnencaoj7mbp1:shell caoj7$ cat phone.cdb zhangsan 18899999999 cnencaoj7mbp1:shell caoj7$ cat phone.sh #!/bin/bash phone_book="phone.cdb" menu_choice="" tmp_file=tmp.$$ trap 'rm -f $phone_book' INT原创 2012-10-08 17:16:42 · 683 阅读 · 0 评论 -
shell-011: gquestionaire
#!/bin/bash gdialog --title "Questionaire" --msgbox "Welcome to my simple survey" 9 18 gdialog --title "Confirm" --yesno "Are you willing to take part?" 9 18 if [ $? != 0 ]; then gdialog --inf原创 2012-10-08 17:17:43 · 844 阅读 · 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 · 2148 阅读 · 0 评论 -
shell-007: if elif else
#!/bin/bash echo -n "Is it morning? please input yes or no: " read yesorno if "$yesorno" = y* then echo "Good morning" elif [ "$yesorno" = "no" ] || [ "$yesorno" = "NO" ] then echo "Go原创 2012-10-08 16:57:27 · 1560 阅读 · 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 · 643 阅读 · 0 评论 -
常规正则表达式
常规正则表达式: 元字符及其在正则表达式上下文中的行为: / 将下一个字符标记为一个特殊字符、或一个原义字符、或一个后向引用、或一个八进制转义符。 ^ 匹配输入字符串的开始位置。如果设置了 RegExp 对象的Multiline 属性,^ 也匹配 ’/n’ 或 ’/r’ 之后的位置。 $ 匹配输入字符串的结束位置。如果设置了 RegExp 对象的Multiline 属性,$ 也匹配 ’转载 2012-10-09 11:07:12 · 848 阅读 · 0 评论