
makefile&shell script
菩提本無樹-永不放棄
这个作者很懒,什么都没留下…
展开
-
windows 批次檔 for loop
windows 批次檔1.loop 從0開始,每次加1,直到302.執行完IT6332B_on.exe3.等80秒4.執行完IT6332B_off.exe5.等6秒6.Loop,重新執行2~5步驟, 直到i等於30for /L %%i in (0 1 30) do (start D:\Power_supply_on_off\IT6332B_on.exetimeout /t 80 /nobreakstart D:\Power_supply_on_off\IT6332B_o原创 2020-12-03 20:06:42 · 452 阅读 · 0 评论 -
vim use command to change window size
改變垂直視窗的size:vertical resize +18or:vertical resize -10改變水平視窗的sizeresize+18orresize-10原创 2020-06-24 14:23:12 · 200 阅读 · 0 评论 -
check MAC Address Validation
轉載自https://raam.org/2009/mac-address-validation-regex-with-egrep/MAC Address Validation Regex with egrepI needed an easy way to validate a MAC address in a bash script that generated a uniqu转载 2015-06-24 16:08:46 · 563 阅读 · 0 评论 -
copy from one array to another
轉載自http://stackoverflow.com/questions/19417015/bash-copy-from-one-array-to-anothera=(foo bar "foo 1" "bar two") #create an arrayb=("${a[@]}") #copy the array in another one转载 2015-06-30 14:00:07 · 420 阅读 · 0 评论 -
makefile的三個特殊符號(= := ?=)
轉載自http://www.gnu.org/software/make/manual/html_node/Flavors.html#Flavors1.There is another assignment operator for variables, ‘?=’. This is called a conditional variable assignment operator,转载 2015-09-08 11:35:53 · 387 阅读 · 0 评论 -
Use a variable reference “inside” another variable
轉載自http://stackoverflow.com/questions/10820343/how-can-i-generate-new-variable-names-on-the-fly-in-a-shell-script SAMPLE1='1-first.with.custom.name'SAMPLE2='2-second.with.custom.name'for (( i转载 2015-11-02 19:24:29 · 427 阅读 · 0 评论 -
Makefile有三个非常有用的变量
Makefile有三个非常有用的变量。分别是$@,$^,$<代表的意义分别是: $@--目标文件,$^--所有的依赖文件,$<--第一个依赖文件。转载 2018-03-07 14:37:02 · 148 阅读 · 0 评论 -
Makefile的ifeq逻辑或,逻辑与的变通实现
-------------邏輯 "OR"------------#VMX_MODE=y#NORMAL_MODE=yall:ifeq ($(findstring y, $(VMX_MODE) $(NORMAL_MODE)), y)@echo "successful"else@echo "failed"endifref https://blog.youkuaiyun.com/u010312...转载 2018-08-14 12:43:37 · 3528 阅读 · 0 评论 -
named pipes
轉載自https://www.linuxjournal.com/content/using-named-pipes-fifos-bashIt's hard to write a bash script of much import without using a pipe or two. Named pipes, on the other hand, are much rarer.Like...转载 2018-08-15 15:11:43 · 897 阅读 · 0 评论 -
How to assign the cat output of a bash script to a variable in another script
轉載自https://unix.stackexchange.com/questions/181423/how-to-assign-the-cat-output-of-a-bash-script-to-a-variable-in-another-script var=$( cat foo.txt )would store the output of the cat in variabl...转载 2018-08-17 10:58:01 · 152 阅读 · 0 评论 -
shell中的括号(小括号,中括号,大括号)
轉載自 https://blog.youkuaiyun.com/tttyd/article/details/11742241转载 2018-08-17 14:33:18 · 214 阅读 · 0 评论 -
how to monitor Internet connection status
ref:https://unix.stackexchange.com/questions/251625/how-to-log-internet-connection-drops while :do for interface in $(ls /sys/class/net/ | grep -v lo | grep -v p2p0| grep -v wla...转载 2018-08-20 16:46:42 · 177 阅读 · 0 评论 -
Length of string in bash
轉載自 http://stackoverflow.com/questions/17368067/length-of-string-in-bash$ myvar="some string"$ echo ${#myvar} 11Just do this:size=${#myvar} To confirm it was properly saved:$ echo $siz转载 2015-06-24 14:10:18 · 384 阅读 · 0 评论 -
Bash/KSH/SH Shell: Find The Length Of a String On a UNIX, Linux, BSD, and OS X
While writing a shell script you may want to find out the length of a string. While reading GNU expr command man page I found an interesting option as follows:expr length STRINGFor example转载 2015-06-24 11:07:00 · 527 阅读 · 0 评论 -
Makefile 的函数-1
轉載自 http://malihou2008.blog.163.com/blog/static/21182004520124158390765/ Makefile Functionmake 提供了很多函数(包括内置函数和自定义的函数)。这些函数为我们处理变量、文本内容、文件名、命令提供了方便。我们在需要的地方调用函数来处理指定的文本(参数)。函数在调用的地方被替换成它的处理结果。转载 2014-03-27 17:38:20 · 1235 阅读 · 0 评论 -
Makefile 函數使用
轉載自http://blog.youkuaiyun.com/haoel/article/details/2894作者 陈皓使用函数————在Makefile中可以使用函数来处理变量,从而让我们的命令或是规则更为的灵活和具有智能。make所支持的函数也不算很多,不过已经足够我们的操作了。函数调用后,函数的返回值可以当做变量来使用。一、函数的调用语法函数调用,很像变转载 2014-03-22 20:59:10 · 438 阅读 · 0 评论 -
xargs
轉載自http://blog.yam.com/ddy1280/article/13941218 範例: 假設有一個目錄如下 (這個樹狀目錄架構是使用 tree 指令所產生的).|-- Makefile|-- VERSION|-- VERSION.bak|-- inc| |-- fork.h| |-- main.h| `-- m转载 2014-04-02 19:18:03 · 548 阅读 · 0 评论 -
Makefile 的变量-2
轉載自 http://malihou2008.blog.163.com/blog/static/21182004520124157330988/ Makefile Variablemakefile 中的变量除了在 makefile 中自定义的之外,还可以来自 make 内置缺省变量(default variable)、make 内置自动化变量(automatic varia转载 2014-03-27 17:39:27 · 1629 阅读 · 0 评论 -
Makefile if特殊用法
==================Makefile start=======================BUILD_DEST=/tmp/BUILD_DESTTARGET_PREFIX=/tmp.PHONY: prepareprepare: $(if $(wildcard $(BUILD_DEST)),,mkdir -p $(BUILD_DEST)) $原创 2014-06-04 14:10:05 · 2057 阅读 · 0 评论 -
svn 相關經驗 svn checkout with commit times (keep original timestamp)
svn checkout with commit times (keep original timestamp)svn co --config-option config:miscellany:use-commit-times=yes svnserverip/projectnameex: svn co --config-option config:miscellany:use-转载 2014-06-10 15:05:46 · 846 阅读 · 0 评论 -
[轉載]例解 autoconf 和 automake 生成 Makefile 文件
http://www.ibm.com/developerworks/cn/linux/l-makefile/转载 2014-06-10 14:33:32 · 366 阅读 · 0 评论 -
如何替Makefile加上build code的總時間長短
MAKE=`which make` TIME=`which time`TIME_OPTIONS="--portability" $TIME $TIME_OPTIONS $MAKE转载 2014-06-17 20:30:36 · 483 阅读 · 0 评论 -
How to pass macro definition from “makefile” command line arguments to C source code?
12345678#FILENAME:Makefileexport SAI=y ifeq ($(SAI),y)CFLAGS += -DSAIendif all: @gcc $(CFLAGS) macro_test.c -o ma原创 2014-12-03 14:29:55 · 708 阅读 · 0 评论 -
shell script set 用法
set錯誤直接停止, 在最上面加上:set -e錯誤不停止,繼續執行set +e转载 2015-01-22 10:59:29 · 629 阅读 · 0 评论 -
script 中使用 trap
轉載自http://blog.crboy.net/2012/03/trap-in-bash-zsh-script.html在 bash (zsh) script 中使用 trap最近在跑分散式的程式,每次測試都要開好幾隻程式在跑。就算可以寫 script 自動開啟,還是會遇到一個很討厭的問題,沒辦法自動關閉那些屬於 worker 的程式。好像解釋的不太清楚.转载 2015-05-12 18:29:15 · 376 阅读 · 0 评论 -
makefile判斷資料夾否存在
TOOLCHAIN_VER := gcc-XXX-XXXTOOLCHAIN_PTH := $(shell cd /opt/toolchains/$(TOOLCHAIN_VER) && pwd)$(if $(TOOLCHAIN_PTH),, $(error toolchain directory "$(TOOLCHAIN_VER)" does not exist))转载 2015-05-27 17:10:14 · 385 阅读 · 0 评论 -
Makefile – Check if a file exists using wildcard function
轉載自 http://www.humbug.in/2012/makefile-check-if-a-file-exists-using-wildcard-function/http://stackoverflow.com/questions/1077676/how-to-conditional-set-up-a-makefile-variable-by-testing-if-a-file-转载 2015-05-21 15:32:46 · 2776 阅读 · 0 评论 -
makefile shell function
$(shell)$(shell) is a special function in gmake that runs an external command and captures the output for use in the makefile.For example, you could get the current working directory like this转载 2014-02-13 11:16:11 · 553 阅读 · 0 评论