Linux | Shell
gjwang1983
这个作者很懒,什么都没留下…
展开
-
a bteq shell wrapper
# bteqshellwrapper.ksh USAGE_pet_bteq(){cat #USAGE: bteqshellwrapper.ksh SQLFILE#PARAMETER: # 1. SQLFILE - the sql file name to be executed by bteq, without path.EOI}if [ $# -ne 1 ]then原创 2009-07-20 15:09:00 · 1007 阅读 · 1 评论 -
Shell - Variable
1. String Length - 变量前面加个#strVar=wang.guan.junecho ${#strVar}13 2. Substring - # and %strVar=wang.guan.jun--# 从首部开始搜索匹配的模式,然后返回剩余的部分就是子串。echo ${strVar#*.} -匹配到wang.guan.jun e原创 2009-12-29 10:32:00 · 483 阅读 · 0 评论 -
SSH Tunneling
Start to take over new role in new team...Prepared for success in all new endeavors! Now... to understand how SSH tunnel works. here is a good article.http://www.bitvise.com/port-forwarding.ht转载 2010-02-19 23:06:00 · 462 阅读 · 0 评论 -
SSH RSA AUTHENTICATION CONFIGURATION
我们通常会在Shell脚本里用ssh登录到远程主机上。但是如果不用RSA认证的话,会提示输入登录密码,这就不利于非交互形式下的自动化处理。 关于ssh rsa的配置很简单,需要注意的地方时几个文件的访问权限。现在有两台主机,local和remote,我们希望在local上执行ssh remote不需要输入密码自动登录到remote上。配置如下:##On Local##1. cd原创 2009-08-03 21:17:00 · 1601 阅读 · 0 评论 -
link
<br />rmdir secondary<br /> <br />ln -s extract secondary<br /> <br />ls -l<br /> <br />lrwxrwxrwx 1 guanwang ebayuser 7 Oct 8 22:32 secondary -> extract原创 2010-10-09 13:34:00 · 516 阅读 · 0 评论 -
MESSAGE: [unixODBC][MySQL][ODBC 3.51 Driver]Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
MESSAGE: [unixODBC][MySQL][ODBC 3.51 Driver]Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)這個錯誤需要在DBC文件里指定ODBCINI的目錄。原创 2010-09-14 11:13:00 · 1580 阅读 · 0 评论 -
shell 程序的搜索PATH
今天写了段shell程序,可是怎么运行都不是我要的结果。后来才发现在搜索路径中,在我当前目录之前的一个目录里已经有了一个同名的shell脚本文件。 具体案例:我的shell程序位于 > ls ~myhome/bin/test.sh/export/home/myhome/bin/test.sh> echo $PATH/usr/bin:/export/allexe:.原创 2009-06-23 16:13:00 · 508 阅读 · 0 评论 -
单词统计函数 - WC
wc (short for word count) is a command in Unix-like operating systems.The program reads either standard input or a list of files and generates one or more of the following statistics: number of byte原创 2009-06-09 21:57:00 · 1049 阅读 · 0 评论 -
A SHELL SCRIPT calling the bteqshellwrapper.ksh
#!/usr/bin/ksh -eu. $HOME/bin/var.setupexport FROM_DT_TMP_FILE=$HOME/FROM_EXTRACT_DT.tmpexport FROM_EXTRACT_DT=2000/01/01loopFlag=1while [ "${loopFlag}" -eq 1 ]do #empty the bteq exported file原创 2009-07-21 21:04:00 · 747 阅读 · 0 评论 -
unix 发 email
cat $ZIP_NAME.tmp |mailx -s "$EMAIL_SUBJECT" $EMAIL_GROUP $ADD_EMAIL$ZIP_NAME.tmp attachment"$EMAIL_SUBJECT" 主题$EMAIL_GROUP 主接收人$ADD_EMAIL 其他接收人原创 2011-01-19 10:30:00 · 855 阅读 · 0 评论