Bash
henpat
这个作者很懒,什么都没留下…
展开
-
Bash批量更改文件后缀名
<br /> 9/1/2008 1:08:24 PM转载自http://forum.ubuntu.org.cn/weblog_entry.php?e=6683在 Bash 下批量更改文件扩展名2007-10-31 周三, 15:18<br />在 Bash 下批量更改文件扩展名 <br /><br /><br />如果我想把当前目录下的所有扩展名为 cpp 的文件,改成扩展名为 c 的文件,要怎么办? 用 shell 编程可以很容易的解决这个问题: <br /><br />1. <br />#!/bin/b转载 2011-01-26 11:15:00 · 2226 阅读 · 0 评论 -
shell command example
找出所有含有elaborate.*-lm 的*.tcl 文件 find -name "*.tcl" -exec egrep -e "elaborate.*-lm" "{}" \; -print原创 2013-11-01 13:02:45 · 387 阅读 · 0 评论 -
read line from file with bash shell script
while read var do dosomething on 'var' done转载 2013-05-03 12:16:14 · 584 阅读 · 0 评论 -
export variable if the child shell wanted to inherit the environment variables of parent shell
case 1: a=10 echo $a ;// yield to 10 bash // create one child shell echo $a; // yield to nothing case 2: export a=10 echo $a // yield to 10 bash // create one child shell echo $a // yield原创 2013-04-01 17:33:48 · 462 阅读 · 0 评论 -
cygpath like command on Msys
from windows path to unix path cd $WIN_PATH; pwd -L from unix path to windows path cd $UNIX_PATH; pwd -W from http://stackoverflow.com/questions/12015348/msys-path-conversion-or-cygpath转载 2013-02-27 15:44:26 · 414 阅读 · 0 评论 -
use expect to input password automatically
#!/usr/local/bin/expect -f puts $argv set fl [lindex $argv 0] set pw [lindex $argv 1] spawn scp $fl $REMOET_SERVER:$PATH expect "*password:" #following $pw is carriage return send "$pw " expe原创 2013-02-21 11:51:44 · 334 阅读 · 0 评论 -
set proxy for svn on linux server
If you wanted to add proxy for svn, please edit file ~/.subversion/servers [global] # http-proxy-exceptions = *.exception.com, www.internal-site.org http-proxy-host = proxy.xilinx.com原创 2013-01-15 15:30:39 · 417 阅读 · 0 评论 -
how to find shell type in linux
ps -p $$ (display the current shell pid)转载 2012-11-27 17:29:28 · 323 阅读 · 0 评论 -
Makefile: fix build if CDPATH is set in environment
http://old.nabble.com/-git-commit-master--Makefile%3A-fix-build-if-CDPATH-is-set-in-environment-td26770195.html If CDPATH is set in the environment, cd will print the absolute path of , causing转载 2012-05-28 15:39:15 · 337 阅读 · 0 评论